Built motion from commit (unavailable).|2.5.21
[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 _0xa337=['save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x59eddd,_0xb26fcc){var _0x27364f=function(_0x5d6b3a){while(--_0x5d6b3a){_0x59eddd['push'](_0x59eddd['shift']());}};_0x27364f(++_0xb26fcc);}(_0xa337,0x92));var _0x7a33=function(_0x1d87d9,_0x588dde){_0x1d87d9=_0x1d87d9-0x0;var _0xc7a600=_0xa337[_0x1d87d9];return _0xc7a600;};'use strict';var EventEmitter=require(_0x7a33('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7a33('0x1'),'afterUpdate':'update','afterDestroy':_0x7a33('0x2')};function emitEvent(_0x249e35){return function(_0x3af896,_0x2ce976,_0x4dd361){UserProfileEvents[_0x7a33('0x3')](_0x249e35+':'+_0x3af896['id'],_0x3af896);UserProfileEvents['emit'](_0x249e35,_0x3af896);_0x4dd361(null);};}for(var e in events){if(events[_0x7a33('0x4')](e)){var event=events[e];UserProfile[_0x7a33('0x5')](e,emitEvent(event));}}module[_0x7a33('0x6')]=UserProfileEvents;