Built motion from commit (unavailable).|2.5.20
[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 _0x3ba8=['emit','hook','events','../../mysqldb','UserProfile','setMaxListeners','update','remove'];(function(_0x1cc0f2,_0x1bccc8){var _0x52a5b3=function(_0x56f4d4){while(--_0x56f4d4){_0x1cc0f2['push'](_0x1cc0f2['shift']());}};_0x52a5b3(++_0x1bccc8);}(_0x3ba8,0xaa));var _0x83ba=function(_0xd419d5,_0xdf1ba0){_0xd419d5=_0xd419d5-0x0;var _0x5d3e6b=_0x3ba8[_0xd419d5];return _0x5d3e6b;};'use strict';var EventEmitter=require(_0x83ba('0x0'));var UserProfile=require(_0x83ba('0x1'))['db'][_0x83ba('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x83ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83ba('0x4'),'afterDestroy':_0x83ba('0x5')};function emitEvent(_0x4f65ab){return function(_0x15aea,_0x2a4d43,_0xe59ad8){UserProfileEvents[_0x83ba('0x6')](_0x4f65ab+':'+_0x15aea['id'],_0x15aea);UserProfileEvents[_0x83ba('0x6')](_0x4f65ab,_0x15aea);_0xe59ad8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x83ba('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents;