ddb0b38670f24c1226da6456185445912e41fbf9
[motion2.git] / server / api / user-setting / user-setting.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 _0x113c=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x12cf12,_0x49428f){var _0x29ffaf=function(_0x5f4003){while(--_0x5f4003){_0x12cf12['push'](_0x12cf12['shift']());}};_0x29ffaf(++_0x49428f);}(_0x113c,0x66));var _0xc113=function(_0x3e311f,_0x19c0ce){_0x3e311f=_0x3e311f-0x0;var _0x501a48=_0x113c[_0x3e311f];return _0x501a48;};'use strict';var EventEmitter=require(_0xc113('0x0'));var UserSetting=require(_0xc113('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc113('0x2'),'afterUpdate':_0xc113('0x3'),'afterDestroy':_0xc113('0x4')};function emitEvent(_0x2a4c42){return function(_0x374c09,_0xcb92bc,_0x39cabd){UserSettingEvents[_0xc113('0x5')](_0x2a4c42+':'+_0x374c09['id'],_0x374c09);UserSettingEvents[_0xc113('0x5')](_0x2a4c42,_0x374c09);_0x39cabd(null);};}for(var e in events){if(events[_0xc113('0x6')](e)){var event=events[e];UserSetting[_0xc113('0x7')](e,emitEvent(event));}}module[_0xc113('0x8')]=UserSettingEvents;