Built motion from commit 538092ac.|2.6.10
[motion2.git] / server / api / faxAccount / faxAccount.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 _0xf110=['events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1d6c09,_0x2e7771){var _0x3f49a7=function(_0x4e6634){while(--_0x4e6634){_0x1d6c09['push'](_0x1d6c09['shift']());}};_0x3f49a7(++_0x2e7771);}(_0xf110,0x134));var _0x0f11=function(_0x218681,_0x16971b){_0x218681=_0x218681-0x0;var _0x56c5de=_0xf110[_0x218681];return _0x56c5de;};'use strict';var EventEmitter=require(_0x0f11('0x0'));var FaxAccount=require(_0x0f11('0x1'))['db'][_0x0f11('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0f11('0x3')](0x0);var events={'afterCreate':_0x0f11('0x4'),'afterUpdate':_0x0f11('0x5'),'afterDestroy':_0x0f11('0x6')};function emitEvent(_0x1b1698){return function(_0x17090c,_0x2d99fc,_0x737dca){FaxAccountEvents[_0x0f11('0x7')](_0x1b1698+':'+_0x17090c['id'],_0x17090c);FaxAccountEvents[_0x0f11('0x7')](_0x1b1698,_0x17090c);_0x737dca(null);};}for(var e in events){if(events[_0x0f11('0x8')](e)){var event=events[e];FaxAccount[_0x0f11('0x9')](e,emitEvent(event));}}module[_0x0f11('0xa')]=FaxAccountEvents;