f377adcdcc622c660edef666b500f88fe9cb2c66
[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 _0x765a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x5e548b,_0x11b798){var _0x36ad97=function(_0x399f7f){while(--_0x399f7f){_0x5e548b['push'](_0x5e548b['shift']());}};_0x36ad97(++_0x11b798);}(_0x765a,0x143));var _0xa765=function(_0x552e6a,_0x249b42){_0x552e6a=_0x552e6a-0x0;var _0x1c38bd=_0x765a[_0x552e6a];return _0x1c38bd;};'use strict';var EventEmitter=require(_0xa765('0x0'));var FaxAccount=require(_0xa765('0x1'))['db'][_0xa765('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa765('0x3')](0x0);var events={'afterCreate':_0xa765('0x4'),'afterUpdate':_0xa765('0x5'),'afterDestroy':_0xa765('0x6')};function emitEvent(_0xec6298){return function(_0x41da26,_0x1c5cbb,_0x17fbd0){FaxAccountEvents[_0xa765('0x7')](_0xec6298+':'+_0x41da26['id'],_0x41da26);FaxAccountEvents[_0xa765('0x7')](_0xec6298,_0x41da26);_0x17fbd0(null);};}for(var e in events){if(events[_0xa765('0x8')](e)){var event=events[e];FaxAccount[_0xa765('0x9')](e,emitEvent(event));}}module[_0xa765('0xa')]=FaxAccountEvents;