Built motion from commit 85328c08.|2.5.50
[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 _0x1a46=['setMaxListeners','save','update','remove','exports','../../mysqldb'];(function(_0x17de2c,_0x1e6708){var _0xbe6716=function(_0x347adc){while(--_0x347adc){_0x17de2c['push'](_0x17de2c['shift']());}};_0xbe6716(++_0x1e6708);}(_0x1a46,0x13d));var _0x61a4=function(_0x5f25d2,_0x3e6525){_0x5f25d2=_0x5f25d2-0x0;var _0x229197=_0x1a46[_0x5f25d2];return _0x229197;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x61a4('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x61a4('0x1')](0x0);var events={'afterCreate':_0x61a4('0x2'),'afterUpdate':_0x61a4('0x3'),'afterDestroy':_0x61a4('0x4')};function emitEvent(_0x57214c){return function(_0x169d56,_0x4d0343,_0x1bd8ff){UserSettingEvents['emit'](_0x57214c+':'+_0x169d56['id'],_0x169d56);UserSettingEvents['emit'](_0x57214c,_0x169d56);_0x1bd8ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x61a4('0x5')]=UserSettingEvents;