Built motion from commit 0415ced0.|2.6.28
[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 _0x3c2f=['exports','events','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xde585e,_0x303d77){var _0x192c55=function(_0xf13d5c){while(--_0xf13d5c){_0xde585e['push'](_0xde585e['shift']());}};_0x192c55(++_0x303d77);}(_0x3c2f,0x191));var _0xf3c2=function(_0x3f6c60,_0x486af8){_0x3f6c60=_0x3f6c60-0x0;var _0x2bbe6a=_0x3c2f[_0x3f6c60];return _0x2bbe6a;};'use strict';var EventEmitter=require(_0xf3c2('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xf3c2('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf3c2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf3c2('0x3'),'afterDestroy':_0xf3c2('0x4')};function emitEvent(_0x405602){return function(_0x494d2f,_0x457e5a,_0x8373dc){DashboardItemEvents['emit'](_0x405602+':'+_0x494d2f['id'],_0x494d2f);DashboardItemEvents[_0xf3c2('0x5')](_0x405602,_0x494d2f);_0x8373dc(null);};}for(var e in events){if(events[_0xf3c2('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf3c2('0x7')]=DashboardItemEvents;