Built motion from commit 8c034dcd.|2.6.31
[motion2.git] / server / api / openchannelAccount / openchannelAccount.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 _0x878f=['hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x444198,_0x52be8a){var _0x5036c2=function(_0x2efcb3){while(--_0x2efcb3){_0x444198['push'](_0x444198['shift']());}};_0x5036c2(++_0x52be8a);}(_0x878f,0x173));var _0xf878=function(_0x5f4a0f,_0x55471f){_0x5f4a0f=_0x5f4a0f-0x0;var _0x358fd5=_0x878f[_0x5f4a0f];return _0x358fd5;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xf878('0x0'))['db'][_0xf878('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf878('0x2')](0x0);var events={'afterCreate':_0xf878('0x3'),'afterUpdate':_0xf878('0x4'),'afterDestroy':_0xf878('0x5')};function emitEvent(_0x9e6783){return function(_0x45a37b,_0x240b48,_0xcf1927){OpenchannelAccountEvents[_0xf878('0x6')](_0x9e6783+':'+_0x45a37b['id'],_0x45a37b);OpenchannelAccountEvents['emit'](_0x9e6783,_0x45a37b);_0xcf1927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xf878('0x7')](e,emitEvent(event));}}module[_0xf878('0x8')]=OpenchannelAccountEvents;