Built motion from commit (unavailable).|2.5.22
[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 _0xfdb3=['../../mysqldb','save','update','emit','hasOwnProperty','hook','events'];(function(_0x2c0b5c,_0x2de2b0){var _0x331c54=function(_0x25251b){while(--_0x25251b){_0x2c0b5c['push'](_0x2c0b5c['shift']());}};_0x331c54(++_0x2de2b0);}(_0xfdb3,0x13a));var _0x3fdb=function(_0x5c8fba,_0x5b53c3){_0x5c8fba=_0x5c8fba-0x0;var _0x4d8e47=_0xfdb3[_0x5c8fba];return _0x4d8e47;};'use strict';var EventEmitter=require(_0x3fdb('0x0'));var UserProfile=require(_0x3fdb('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3fdb('0x2'),'afterUpdate':_0x3fdb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x23b68e){return function(_0x429257,_0x563644,_0x6841b6){UserProfileEvents[_0x3fdb('0x4')](_0x23b68e+':'+_0x429257['id'],_0x429257);UserProfileEvents['emit'](_0x23b68e,_0x429257);_0x6841b6(null);};}for(var e in events){if(events[_0x3fdb('0x5')](e)){var event=events[e];UserProfile[_0x3fdb('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;