4b5691d95fccd086631f738065994ccc7a8fe38b
[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 _0xeb54=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x361c3c,_0x34e495){var _0x1a68e7=function(_0x1eeba5){while(--_0x1eeba5){_0x361c3c['push'](_0x361c3c['shift']());}};_0x1a68e7(++_0x34e495);}(_0xeb54,0xb7));var _0x4eb5=function(_0x236570,_0x25aabf){_0x236570=_0x236570-0x0;var _0x24266b=_0xeb54[_0x236570];return _0x24266b;};'use strict';var EventEmitter=require(_0x4eb5('0x0'));var FaxAccount=require(_0x4eb5('0x1'))['db'][_0x4eb5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4eb5('0x3')](0x0);var events={'afterCreate':_0x4eb5('0x4'),'afterUpdate':_0x4eb5('0x5'),'afterDestroy':_0x4eb5('0x6')};function emitEvent(_0x4b1538){return function(_0x4eb456,_0x2b8c34,_0xb9897){FaxAccountEvents['emit'](_0x4b1538+':'+_0x4eb456['id'],_0x4eb456);FaxAccountEvents[_0x4eb5('0x7')](_0x4b1538,_0x4eb456);_0xb9897(null);};}for(var e in events){if(events[_0x4eb5('0x8')](e)){var event=events[e];FaxAccount[_0x4eb5('0x9')](e,emitEvent(event));}}module[_0x4eb5('0xa')]=FaxAccountEvents;