Built motion from commit e02f907f.|2.6.14
[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 _0x2c2a=['save','update','emit','hasOwnProperty','hook','exports','UserSetting'];(function(_0x1f5735,_0x1ba7bb){var _0x1c7edc=function(_0x152031){while(--_0x152031){_0x1f5735['push'](_0x1f5735['shift']());}};_0x1c7edc(++_0x1ba7bb);}(_0x2c2a,0x8b));var _0xa2c2=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x2c2a[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xa2c2('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa2c2('0x1'),'afterUpdate':_0xa2c2('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2ae106){return function(_0x41522a,_0x4dee4b,_0x4b80d9){UserSettingEvents[_0xa2c2('0x3')](_0x2ae106+':'+_0x41522a['id'],_0x41522a);UserSettingEvents[_0xa2c2('0x3')](_0x2ae106,_0x41522a);_0x4b80d9(null);};}for(var e in events){if(events[_0xa2c2('0x4')](e)){var event=events[e];UserSetting[_0xa2c2('0x5')](e,emitEvent(event));}}module[_0xa2c2('0x6')]=UserSettingEvents;