Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / userProfile / userProfile.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 _0x74d7=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','remove','emit'];(function(_0x48b623,_0x1fad86){var _0x2be723=function(_0x4005c6){while(--_0x4005c6){_0x48b623['push'](_0x48b623['shift']());}};_0x2be723(++_0x1fad86);}(_0x74d7,0xe2));var _0x774d=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x74d7[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x774d('0x0'));var UserProfile=require(_0x774d('0x1'))['db'][_0x774d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x774d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x774d('0x4')};function emitEvent(_0x47b5a8){return function(_0x1f911d,_0x1b62e7,_0x1ed503){UserProfileEvents[_0x774d('0x5')](_0x47b5a8+':'+_0x1f911d['id'],_0x1f911d);UserProfileEvents['emit'](_0x47b5a8,_0x1f911d);_0x1ed503(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x774d('0x6')](e,emitEvent(event));}}module[_0x774d('0x7')]=UserProfileEvents;