Built motion from commit (unavailable).|2.5.4
[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 _0x297c=['remove','emit','hook','exports','events','UserProfile','setMaxListeners','save','update'];(function(_0x3b2b6a,_0x172d8e){var _0xb7f2a=function(_0x35d08f){while(--_0x35d08f){_0x3b2b6a['push'](_0x3b2b6a['shift']());}};_0xb7f2a(++_0x172d8e);}(_0x297c,0xe5));var _0xc297=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x297c[_0x18cd5b];return _0x5eaa52;};'use strict';var EventEmitter=require(_0xc297('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xc297('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xc297('0x2')](0x0);var events={'afterCreate':_0xc297('0x3'),'afterUpdate':_0xc297('0x4'),'afterDestroy':_0xc297('0x5')};function emitEvent(_0x21eb4d){return function(_0x1fc262,_0x2fdfd3,_0x7da889){UserProfileEvents[_0xc297('0x6')](_0x21eb4d+':'+_0x1fc262['id'],_0x1fc262);UserProfileEvents['emit'](_0x21eb4d,_0x1fc262);_0x7da889(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xc297('0x7')](e,emitEvent(event));}}module[_0xc297('0x8')]=UserProfileEvents;