Built motion from commit 6362bb75.|2.6.13
[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 _0xda69=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0xda69,0x164));var _0x9da6=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xda69[_0x88cd7b];return _0x56fcc8;};'use strict';var EventEmitter=require(_0x9da6('0x0'));var UserSetting=require(_0x9da6('0x1'))['db'][_0x9da6('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x9da6('0x3')](0x0);var events={'afterCreate':_0x9da6('0x4'),'afterUpdate':_0x9da6('0x5'),'afterDestroy':_0x9da6('0x6')};function emitEvent(_0x460d15){return function(_0x50a490,_0xd5be3,_0x51aae0){UserSettingEvents[_0x9da6('0x7')](_0x460d15+':'+_0x50a490['id'],_0x50a490);UserSettingEvents[_0x9da6('0x7')](_0x460d15,_0x50a490);_0x51aae0(null);};}for(var e in events){if(events[_0x9da6('0x8')](e)){var event=events[e];UserSetting[_0x9da6('0x9')](e,emitEvent(event));}}module[_0x9da6('0xa')]=UserSettingEvents;