Built motion from commit (unavailable).|2.5.10
[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 _0x4c1d=['emit','hasOwnProperty','hook','../../mysqldb','UserProfile'];(function(_0x1eff90,_0x45bbd2){var _0x5572e3=function(_0x39c7fb){while(--_0x39c7fb){_0x1eff90['push'](_0x1eff90['shift']());}};_0x5572e3(++_0x45bbd2);}(_0x4c1d,0x16b));var _0xd4c1=function(_0x5922d3,_0xb13516){_0x5922d3=_0x5922d3-0x0;var _0x4bd931=_0x4c1d[_0x5922d3];return _0x4bd931;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd4c1('0x0'))['db'][_0xd4c1('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff3d8){return function(_0x1cbd6a,_0x25dbcd,_0x2938e6){UserProfileEvents[_0xd4c1('0x2')](_0x3ff3d8+':'+_0x1cbd6a['id'],_0x1cbd6a);UserProfileEvents[_0xd4c1('0x2')](_0x3ff3d8,_0x1cbd6a);_0x2938e6(null);};}for(var e in events){if(events[_0xd4c1('0x3')](e)){var event=events[e];UserProfile[_0xd4c1('0x4')](e,emitEvent(event));}}module['exports']=UserProfileEvents;