Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / dashboardItem / dashboardItem.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 _0x7381=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7381,0x18c));var _0x1738=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x7381[_0x5ca5bc];return _0x26ca86;};'use strict';var EventEmitter=require(_0x1738('0x0'));var DashboardItem=require(_0x1738('0x1'))['db'][_0x1738('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1738('0x3')](0x0);var events={'afterCreate':_0x1738('0x4'),'afterUpdate':_0x1738('0x5'),'afterDestroy':_0x1738('0x6')};function emitEvent(_0x35ff82){return function(_0xac2aea,_0x369547,_0x3ee25c){DashboardItemEvents[_0x1738('0x7')](_0x35ff82+':'+_0xac2aea['id'],_0xac2aea);DashboardItemEvents[_0x1738('0x7')](_0x35ff82,_0xac2aea);_0x3ee25c(null);};}for(var e in events){if(events[_0x1738('0x8')](e)){var event=events[e];DashboardItem[_0x1738('0x9')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;