Built motion from commit 19a84241.|2.5.34
[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 _0xfe29=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit'];(function(_0x418bb0,_0x2c5261){var _0x54054e=function(_0x3b672c){while(--_0x3b672c){_0x418bb0['push'](_0x418bb0['shift']());}};_0x54054e(++_0x2c5261);}(_0xfe29,0x1ed));var _0x9fe2=function(_0x4bc492,_0x162284){_0x4bc492=_0x4bc492-0x0;var _0x313cd6=_0xfe29[_0x4bc492];return _0x313cd6;};'use strict';var EventEmitter=require(_0x9fe2('0x0'));var FaxAccount=require(_0x9fe2('0x1'))['db'][_0x9fe2('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9fe2('0x3')](0x0);var events={'afterCreate':_0x9fe2('0x4'),'afterUpdate':_0x9fe2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f31bd){return function(_0x2bb011,_0x839fed,_0x3bc204){FaxAccountEvents[_0x9fe2('0x6')](_0x1f31bd+':'+_0x2bb011['id'],_0x2bb011);FaxAccountEvents['emit'](_0x1f31bd,_0x2bb011);_0x3bc204(null);};}for(var e in events){if(events[_0x9fe2('0x7')](e)){var event=events[e];FaxAccount[_0x9fe2('0x8')](e,emitEvent(event));}}module[_0x9fe2('0x9')]=FaxAccountEvents;