Built motion from commit 3a7e82ea.|2.6.29
[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 _0x3e0c=['exports','events','../../mysqldb','UserProfile','save','update','remove'];(function(_0x253c6a,_0xa23815){var _0x5511fc=function(_0x4e594a){while(--_0x4e594a){_0x253c6a['push'](_0x253c6a['shift']());}};_0x5511fc(++_0xa23815);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x1ce595,_0x1069cb){_0x1ce595=_0x1ce595-0x0;var _0x525dfe=_0x3e0c[_0x1ce595];return _0x525dfe;};'use strict';var EventEmitter=require(_0xc3e0('0x0'));var UserProfile=require(_0xc3e0('0x1'))['db'][_0xc3e0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e0('0x3'),'afterUpdate':_0xc3e0('0x4'),'afterDestroy':_0xc3e0('0x5')};function emitEvent(_0x2ba135){return function(_0xba1d4c,_0x49e5b7,_0x88cddb){UserProfileEvents['emit'](_0x2ba135+':'+_0xba1d4c['id'],_0xba1d4c);UserProfileEvents['emit'](_0x2ba135,_0xba1d4c);_0x88cddb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xc3e0('0x6')]=UserProfileEvents;