8a5208b9c6c5de695c2961a6bfe1a5e101ad01a7
[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 _0x50a5=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x492aff,_0x3d2e41){var _0x517a11=function(_0x27e7b6){while(--_0x27e7b6){_0x492aff['push'](_0x492aff['shift']());}};_0x517a11(++_0x3d2e41);}(_0x50a5,0xd1));var _0x550a=function(_0x355377,_0xe3a437){_0x355377=_0x355377-0x0;var _0x458c8c=_0x50a5[_0x355377];return _0x458c8c;};'use strict';var EventEmitter=require(_0x550a('0x0'));var UserProfile=require(_0x550a('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x550a('0x2')};function emitEvent(_0x4827e0){return function(_0x357485,_0x2038f7,_0x45ca06){UserProfileEvents[_0x550a('0x3')](_0x4827e0+':'+_0x357485['id'],_0x357485);UserProfileEvents[_0x550a('0x3')](_0x4827e0,_0x357485);_0x45ca06(null);};}for(var e in events){if(events[_0x550a('0x4')](e)){var event=events[e];UserProfile[_0x550a('0x5')](e,emitEvent(event));}}module[_0x550a('0x6')]=UserProfileEvents;