1673d3e950be9cb6c2c477ba1fc4e0135aba782f
[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 _0x752f=['emit','hasOwnProperty','exports','FaxAccount','setMaxListeners','save','update'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x752f,0x10d));var _0xf752=function(_0x19e6e7,_0x542566){_0x19e6e7=_0x19e6e7-0x0;var _0x374453=_0x752f[_0x19e6e7];return _0x374453;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0xf752('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf752('0x1')](0x0);var events={'afterCreate':_0xf752('0x2'),'afterUpdate':_0xf752('0x3'),'afterDestroy':'remove'};function emitEvent(_0x433a15){return function(_0x2f7620,_0x2e7c4f,_0x1ff40c){FaxAccountEvents[_0xf752('0x4')](_0x433a15+':'+_0x2f7620['id'],_0x2f7620);FaxAccountEvents[_0xf752('0x4')](_0x433a15,_0x2f7620);_0x1ff40c(null);};}for(var e in events){if(events[_0xf752('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xf752('0x6')]=FaxAccountEvents;