Built motion from commit ffdca78c.|2.6.24
[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 _0xc062=['remove','emit','hasOwnProperty','hook','exports','events','FaxAccount','save','update'];(function(_0x528e85,_0x51a8af){var _0x1ca5e1=function(_0x2acc70){while(--_0x2acc70){_0x528e85['push'](_0x528e85['shift']());}};_0x1ca5e1(++_0x51a8af);}(_0xc062,0x71));var _0x2c06=function(_0x4b70f0,_0x129738){_0x4b70f0=_0x4b70f0-0x0;var _0x321188=_0xc062[_0x4b70f0];return _0x321188;};'use strict';var EventEmitter=require(_0x2c06('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x2c06('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c06('0x2'),'afterUpdate':_0x2c06('0x3'),'afterDestroy':_0x2c06('0x4')};function emitEvent(_0x8604d3){return function(_0x3d388b,_0x4531df,_0x4b1a42){FaxAccountEvents[_0x2c06('0x5')](_0x8604d3+':'+_0x3d388b['id'],_0x3d388b);FaxAccountEvents['emit'](_0x8604d3,_0x3d388b);_0x4b1a42(null);};}for(var e in events){if(events[_0x2c06('0x6')](e)){var event=events[e];FaxAccount[_0x2c06('0x7')](e,emitEvent(event));}}module[_0x2c06('0x8')]=FaxAccountEvents;