564dd92eca0566beb17c7723afe717836817f2a5
[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 _0xc6c0=['emit','hook','exports','events','UserProfile','setMaxListeners','save','update','remove'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xc6c0[_0x495e9f];return _0xb249d2;};'use strict';var EventEmitter=require(_0x0c6c('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x0c6c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0c6c('0x2')](0x0);var events={'afterCreate':_0x0c6c('0x3'),'afterUpdate':_0x0c6c('0x4'),'afterDestroy':_0x0c6c('0x5')};function emitEvent(_0x1d9169){return function(_0x27032,_0x6f9f0f,_0x43801c){UserProfileEvents[_0x0c6c('0x6')](_0x1d9169+':'+_0x27032['id'],_0x27032);UserProfileEvents['emit'](_0x1d9169,_0x27032);_0x43801c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x0c6c('0x7')](e,emitEvent(event));}}module[_0x0c6c('0x8')]=UserProfileEvents;