Built motion from commit fda31434.|2.5.44
[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 _0xa7fb=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa7fb,0xf6));var _0xba7f=function(_0x19fb9f,_0x2e105c){_0x19fb9f=_0x19fb9f-0x0;var _0x16ce95=_0xa7fb[_0x19fb9f];return _0x16ce95;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xba7f('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xba7f('0x1')](0x0);var events={'afterCreate':_0xba7f('0x2'),'afterUpdate':_0xba7f('0x3'),'afterDestroy':_0xba7f('0x4')};function emitEvent(_0x1497e1){return function(_0x2a7569,_0x183697,_0x223e8a){FaxAccountEvents['emit'](_0x1497e1+':'+_0x2a7569['id'],_0x2a7569);FaxAccountEvents[_0xba7f('0x5')](_0x1497e1,_0x2a7569);_0x223e8a(null);};}for(var e in events){if(events[_0xba7f('0x6')](e)){var event=events[e];FaxAccount[_0xba7f('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;