Built motion from commit e02f907f.|2.6.14
[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 _0x73ac=['exports','events','DashboardItem','setMaxListeners','save','update','emit','hook'];(function(_0x8935ce,_0x3621c3){var _0x1a422f=function(_0x35cb66){while(--_0x35cb66){_0x8935ce['push'](_0x8935ce['shift']());}};_0x1a422f(++_0x3621c3);}(_0x73ac,0x1a1));var _0xc73a=function(_0x5b5a0d,_0x35b71e){_0x5b5a0d=_0x5b5a0d-0x0;var _0x3ec0f0=_0x73ac[_0x5b5a0d];return _0x3ec0f0;};'use strict';var EventEmitter=require(_0xc73a('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xc73a('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc73a('0x2')](0x0);var events={'afterCreate':_0xc73a('0x3'),'afterUpdate':_0xc73a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x559f45){return function(_0x5bc250,_0x34226e,_0x352299){DashboardItemEvents['emit'](_0x559f45+':'+_0x5bc250['id'],_0x5bc250);DashboardItemEvents[_0xc73a('0x5')](_0x559f45,_0x5bc250);_0x352299(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xc73a('0x6')](e,emitEvent(event));}}module[_0xc73a('0x7')]=DashboardItemEvents;