Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / squareProject / squareProject.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1130=['SquareProject','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x13b6fc,_0x539ca2){var _0x5079aa=function(_0x45158f){while(--_0x45158f){_0x13b6fc['push'](_0x13b6fc['shift']());}};_0x5079aa(++_0x539ca2);}(_0x1130,0xe7));var _0x0113=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x1130[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x0113('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0113('0x1'),'afterUpdate':_0x0113('0x2'),'afterDestroy':'remove'};function emitEvent(_0x214dac){return function(_0x325d03,_0xcdf63a,_0x35d677){SquareProjectEvents[_0x0113('0x3')](_0x214dac+':'+_0x325d03['id'],_0x325d03);SquareProjectEvents[_0x0113('0x3')](_0x214dac,_0x325d03);_0x35d677(null);};}for(var e in events){if(events[_0x0113('0x4')](e)){var event=events[e];SquareProject[_0x0113('0x5')](e,emitEvent(event));}}module[_0x0113('0x6')]=SquareProjectEvents;