1cd5a9e05999a74be68fdffece78c206207de42b
[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 _0x4c18=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x25033a,_0x15d628){var _0x1c4665=function(_0x103e9e){while(--_0x103e9e){_0x25033a['push'](_0x25033a['shift']());}};_0x1c4665(++_0x15d628);}(_0x4c18,0xaf));var _0x84c1=function(_0x2eb225,_0x3fda7d){_0x2eb225=_0x2eb225-0x0;var _0x586e11=_0x4c18[_0x2eb225];return _0x586e11;};'use strict';var EventEmitter=require(_0x84c1('0x0'));var FaxAccount=require(_0x84c1('0x1'))['db'][_0x84c1('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84c1('0x3'),'afterUpdate':_0x84c1('0x4'),'afterDestroy':_0x84c1('0x5')};function emitEvent(_0x21a93a){return function(_0x48ee33,_0x45d8ce,_0x254a05){FaxAccountEvents['emit'](_0x21a93a+':'+_0x48ee33['id'],_0x48ee33);FaxAccountEvents[_0x84c1('0x6')](_0x21a93a,_0x48ee33);_0x254a05(null);};}for(var e in events){if(events[_0x84c1('0x7')](e)){var event=events[e];FaxAccount[_0x84c1('0x8')](e,emitEvent(event));}}module[_0x84c1('0x9')]=FaxAccountEvents;