Built motion from commit b5413ace.|2.6.9
[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 _0x41d0=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','setMaxListeners','update'];(function(_0x361098,_0x56950f){var _0x5f56f9=function(_0x4fc5b2){while(--_0x4fc5b2){_0x361098['push'](_0x361098['shift']());}};_0x5f56f9(++_0x56950f);}(_0x41d0,0x1c6));var _0x041d=function(_0x36743b,_0x41426a){_0x36743b=_0x36743b-0x0;var _0xc6db05=_0x41d0[_0x36743b];return _0xc6db05;};'use strict';var EventEmitter=require(_0x041d('0x0'));var UserProfile=require(_0x041d('0x1'))['db'][_0x041d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x041d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x041d('0x4'),'afterDestroy':_0x041d('0x5')};function emitEvent(_0x12e55d){return function(_0x397dad,_0x41e587,_0x3a22a4){UserProfileEvents[_0x041d('0x6')](_0x12e55d+':'+_0x397dad['id'],_0x397dad);UserProfileEvents[_0x041d('0x6')](_0x12e55d,_0x397dad);_0x3a22a4(null);};}for(var e in events){if(events[_0x041d('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x041d('0x8')]=UserProfileEvents;