Built motion from commit 497d3d92.|2.5.43
[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 _0x481e=['emit','hasOwnProperty','hook','exports','events','FaxAccount','save','update','remove'];(function(_0x2ff4c6,_0x57407b){var _0xc8bacc=function(_0x5f0e2d){while(--_0x5f0e2d){_0x2ff4c6['push'](_0x2ff4c6['shift']());}};_0xc8bacc(++_0x57407b);}(_0x481e,0x1c6));var _0xe481=function(_0x56ba8c,_0x5cb474){_0x56ba8c=_0x56ba8c-0x0;var _0x25b005=_0x481e[_0x56ba8c];return _0x25b005;};'use strict';var EventEmitter=require(_0xe481('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xe481('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe481('0x2'),'afterUpdate':_0xe481('0x3'),'afterDestroy':_0xe481('0x4')};function emitEvent(_0x4e3dff){return function(_0x27bede,_0xc61148,_0xdba3a9){FaxAccountEvents[_0xe481('0x5')](_0x4e3dff+':'+_0x27bede['id'],_0x27bede);FaxAccountEvents[_0xe481('0x5')](_0x4e3dff,_0x27bede);_0xdba3a9(null);};}for(var e in events){if(events[_0xe481('0x6')](e)){var event=events[e];FaxAccount[_0xe481('0x7')](e,emitEvent(event));}}module[_0xe481('0x8')]=FaxAccountEvents;