Built motion from commit da24aabd.|2.6.20
[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 _0x6da9=['emit','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x2585cc,_0x4b50b5){var _0x2409a4=function(_0x3f3322){while(--_0x3f3322){_0x2585cc['push'](_0x2585cc['shift']());}};_0x2409a4(++_0x4b50b5);}(_0x6da9,0x161));var _0x96da=function(_0x426ff6,_0x95bea9){_0x426ff6=_0x426ff6-0x0;var _0x4f658a=_0x6da9[_0x426ff6];return _0x4f658a;};'use strict';var EventEmitter=require(_0x96da('0x0'));var FaxAccount=require(_0x96da('0x1'))['db'][_0x96da('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x96da('0x3')](0x0);var events={'afterCreate':_0x96da('0x4'),'afterUpdate':_0x96da('0x5'),'afterDestroy':_0x96da('0x6')};function emitEvent(_0x5198e8){return function(_0x5d07cd,_0x4fd3b8,_0x191a57){FaxAccountEvents[_0x96da('0x7')](_0x5198e8+':'+_0x5d07cd['id'],_0x5d07cd);FaxAccountEvents[_0x96da('0x7')](_0x5198e8,_0x5d07cd);_0x191a57(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x96da('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;