Built motion from commit 9d0783e6.|2.6.13
[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 _0x66c7=['UserProfile','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1c324d,_0x2daa7c){var _0x33347f=function(_0x438dc6){while(--_0x438dc6){_0x1c324d['push'](_0x1c324d['shift']());}};_0x33347f(++_0x2daa7c);}(_0x66c7,0x15c));var _0x766c=function(_0x38e59a,_0x59f346){_0x38e59a=_0x38e59a-0x0;var _0x4410eb=_0x66c7[_0x38e59a];return _0x4410eb;};'use strict';var EventEmitter=require(_0x766c('0x0'));var UserProfile=require(_0x766c('0x1'))['db'][_0x766c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x766c('0x3'),'afterUpdate':_0x766c('0x4'),'afterDestroy':_0x766c('0x5')};function emitEvent(_0x1cf5c1){return function(_0x1b2a8e,_0x2b4c75,_0x4fa5e4){UserProfileEvents[_0x766c('0x6')](_0x1cf5c1+':'+_0x1b2a8e['id'],_0x1b2a8e);UserProfileEvents[_0x766c('0x6')](_0x1cf5c1,_0x1b2a8e);_0x4fa5e4(null);};}for(var e in events){if(events[_0x766c('0x7')](e)){var event=events[e];UserProfile[_0x766c('0x8')](e,emitEvent(event));}}module[_0x766c('0x9')]=UserProfileEvents;