Built motion from commit 43538d75.|2.5.35
[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 _0xa5d1=['hook','exports','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x377377,_0x1565ff){var _0x3456da=function(_0x2df256){while(--_0x2df256){_0x377377['push'](_0x377377['shift']());}};_0x3456da(++_0x1565ff);}(_0xa5d1,0x1c2));var _0x1a5d=function(_0x515dff,_0x1744e2){_0x515dff=_0x515dff-0x0;var _0x362792=_0xa5d1[_0x515dff];return _0x362792;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x1a5d('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1a5d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a5d('0x2'),'afterDestroy':_0x1a5d('0x3')};function emitEvent(_0x12ff11){return function(_0x4b8cf3,_0x5caab9,_0x35722e){FaxAccountEvents[_0x1a5d('0x4')](_0x12ff11+':'+_0x4b8cf3['id'],_0x4b8cf3);FaxAccountEvents[_0x1a5d('0x4')](_0x12ff11,_0x4b8cf3);_0x35722e(null);};}for(var e in events){if(events[_0x1a5d('0x5')](e)){var event=events[e];FaxAccount[_0x1a5d('0x6')](e,emitEvent(event));}}module[_0x1a5d('0x7')]=FaxAccountEvents;