cef0947e657feccfc281d94c5344bc1cbbcc325a
[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 _0x72fa=['save','update','remove','emit','hook','../../mysqldb','setMaxListeners'];(function(_0x35ccd8,_0x537a97){var _0x2f8eb6=function(_0x1696b4){while(--_0x1696b4){_0x35ccd8['push'](_0x35ccd8['shift']());}};_0x2f8eb6(++_0x537a97);}(_0x72fa,0x18d));var _0xa72f=function(_0x5e0e90,_0x1c8363){_0x5e0e90=_0x5e0e90-0x0;var _0x33cfe3=_0x72fa[_0x5e0e90];return _0x33cfe3;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xa72f('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa72f('0x1')](0x0);var events={'afterCreate':_0xa72f('0x2'),'afterUpdate':_0xa72f('0x3'),'afterDestroy':_0xa72f('0x4')};function emitEvent(_0x54b460){return function(_0x50d377,_0x1f3023,_0x2933e4){FaxAccountEvents[_0xa72f('0x5')](_0x54b460+':'+_0x50d377['id'],_0x50d377);FaxAccountEvents['emit'](_0x54b460,_0x50d377);_0x2933e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xa72f('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;