Built motion from commit eddce310.|2.6.12
[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 _0x6fbc=['remove','emit','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x16929c,_0x24dbff){var _0x5d93f4=function(_0x38b4be){while(--_0x38b4be){_0x16929c['push'](_0x16929c['shift']());}};_0x5d93f4(++_0x24dbff);}(_0x6fbc,0x11c));var _0xc6fb=function(_0x52a917,_0x15d07d){_0x52a917=_0x52a917-0x0;var _0x27158b=_0x6fbc[_0x52a917];return _0x27158b;};'use strict';var EventEmitter=require(_0xc6fb('0x0'));var SquareProject=require(_0xc6fb('0x1'))['db'][_0xc6fb('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc6fb('0x3')](0x0);var events={'afterCreate':_0xc6fb('0x4'),'afterUpdate':_0xc6fb('0x5'),'afterDestroy':_0xc6fb('0x6')};function emitEvent(_0x4e4b98){return function(_0x50aae2,_0x2e38b3,_0x2a6aef){SquareProjectEvents[_0xc6fb('0x7')](_0x4e4b98+':'+_0x50aae2['id'],_0x50aae2);SquareProjectEvents['emit'](_0x4e4b98,_0x50aae2);_0x2a6aef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xc6fb('0x8')](e,emitEvent(event));}}module[_0xc6fb('0x9')]=SquareProjectEvents;