Built motion from commit ce97982f.|2.6.29
[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 _0xdc11=['hook','events','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x3c78f1,_0x352f1a){var _0x518acc=function(_0x3ca12f){while(--_0x3ca12f){_0x3c78f1['push'](_0x3c78f1['shift']());}};_0x518acc(++_0x352f1a);}(_0xdc11,0x191));var _0x1dc1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc11[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1dc1('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x1dc1('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1dc1('0x2')](0x0);var events={'afterCreate':_0x1dc1('0x3'),'afterUpdate':_0x1dc1('0x4'),'afterDestroy':_0x1dc1('0x5')};function emitEvent(_0x361520){return function(_0x17b094,_0x474d7b,_0x295d57){UserSettingEvents[_0x1dc1('0x6')](_0x361520+':'+_0x17b094['id'],_0x17b094);UserSettingEvents[_0x1dc1('0x6')](_0x361520,_0x17b094);_0x295d57(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x1dc1('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents;