aced1bc99ede613aa9e5c48e6ba49b6ed9f68433
[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 _0xb9fc=['hook','exports','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xa9a862,_0x24fbbb){var _0x2e1782=function(_0x2c2ce9){while(--_0x2c2ce9){_0xa9a862['push'](_0xa9a862['shift']());}};_0x2e1782(++_0x24fbbb);}(_0xb9fc,0x6e));var _0xcb9f=function(_0x29fbb8,_0x57f966){_0x29fbb8=_0x29fbb8-0x0;var _0x5d9285=_0xb9fc[_0x29fbb8];return _0x5d9285;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0xcb9f('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xcb9f('0x1')](0x0);var events={'afterCreate':_0xcb9f('0x2'),'afterUpdate':_0xcb9f('0x3'),'afterDestroy':_0xcb9f('0x4')};function emitEvent(_0x96544b){return function(_0x4549f2,_0x3f859b,_0x523700){FaxAccountEvents[_0xcb9f('0x5')](_0x96544b+':'+_0x4549f2['id'],_0x4549f2);FaxAccountEvents['emit'](_0x96544b,_0x4549f2);_0x523700(null);};}for(var e in events){if(events[_0xcb9f('0x6')](e)){var event=events[e];FaxAccount[_0xcb9f('0x7')](e,emitEvent(event));}}module[_0xcb9f('0x8')]=FaxAccountEvents;