Built motion from commit 9d0783e6.|2.6.13
[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 _0x7d62=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','remove'];(function(_0xcb8db6,_0x2cf36f){var _0x243c2b=function(_0x4534e9){while(--_0x4534e9){_0xcb8db6['push'](_0xcb8db6['shift']());}};_0x243c2b(++_0x2cf36f);}(_0x7d62,0x123));var _0x27d6=function(_0x57e18a,_0x199383){_0x57e18a=_0x57e18a-0x0;var _0x1181c7=_0x7d62[_0x57e18a];return _0x1181c7;};'use strict';var EventEmitter=require(_0x27d6('0x0'));var FaxAccount=require(_0x27d6('0x1'))['db'][_0x27d6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x27d6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x27d6('0x4')};function emitEvent(_0x297ae2){return function(_0x7bcdac,_0x4d3b2b,_0x1953ca){FaxAccountEvents['emit'](_0x297ae2+':'+_0x7bcdac['id'],_0x7bcdac);FaxAccountEvents['emit'](_0x297ae2,_0x7bcdac);_0x1953ca(null);};}for(var e in events){if(events[_0x27d6('0x5')](e)){var event=events[e];FaxAccount[_0x27d6('0x6')](e,emitEvent(event));}}module[_0x27d6('0x7')]=FaxAccountEvents;