Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / cmList / cmList.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 _0x9c9f=['save','remove','emit','hook','exports','events'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x9c9f,0xb3));var _0xf9c9=function(_0x410074,_0x11835b){_0x410074=_0x410074-0x0;var _0x5eb0de=_0x9c9f[_0x410074];return _0x5eb0de;};'use strict';var EventEmitter=require(_0xf9c9('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf9c9('0x1'),'afterUpdate':'update','afterDestroy':_0xf9c9('0x2')};function emitEvent(_0x238a70){return function(_0x37b6c5,_0x4eaded,_0x400018){CmListEvents['emit'](_0x238a70+':'+_0x37b6c5['id'],_0x37b6c5);CmListEvents[_0xf9c9('0x3')](_0x238a70,_0x37b6c5);_0x400018(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf9c9('0x4')](e,emitEvent(event));}}module[_0xf9c9('0x5')]=CmListEvents;