Built motion from commit 639a1a7f.|2.6.19
[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 _0xb145=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5966b4,_0x6ffc5c){var _0x45eddd=function(_0x1441fe){while(--_0x1441fe){_0x5966b4['push'](_0x5966b4['shift']());}};_0x45eddd(++_0x6ffc5c);}(_0xb145,0xa3));var _0x5b14=function(_0x16d8c1,_0x21bf2b){_0x16d8c1=_0x16d8c1-0x0;var _0x5f11ba=_0xb145[_0x16d8c1];return _0x5f11ba;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x5b14('0x0'))['db'][_0x5b14('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5b14('0x2')](0x0);var events={'afterCreate':_0x5b14('0x3'),'afterUpdate':_0x5b14('0x4'),'afterDestroy':_0x5b14('0x5')};function emitEvent(_0x31f6f0){return function(_0x34b4cd,_0x5111cd,_0x1e0b5b){UserProfileEvents[_0x5b14('0x6')](_0x31f6f0+':'+_0x34b4cd['id'],_0x34b4cd);UserProfileEvents[_0x5b14('0x6')](_0x31f6f0,_0x34b4cd);_0x1e0b5b(null);};}for(var e in events){if(events[_0x5b14('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x5b14('0x8')]=UserProfileEvents;