8b395c6a55cee8fceb637937ae6c0c1f0193e830
[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 _0x77d4=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x142c85,_0x56e09d){var _0x2cf70e=function(_0x1a6998){while(--_0x1a6998){_0x142c85['push'](_0x142c85['shift']());}};_0x2cf70e(++_0x56e09d);}(_0x77d4,0x108));var _0x477d=function(_0x1a15ed,_0x269dc4){_0x1a15ed=_0x1a15ed-0x0;var _0x386030=_0x77d4[_0x1a15ed];return _0x386030;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x477d('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x477d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x477d('0x2'),'afterDestroy':_0x477d('0x3')};function emitEvent(_0x53637c){return function(_0x53e1b8,_0x16213f,_0xf3cde0){UserProfileEvents[_0x477d('0x4')](_0x53637c+':'+_0x53e1b8['id'],_0x53e1b8);UserProfileEvents[_0x477d('0x4')](_0x53637c,_0x53e1b8);_0xf3cde0(null);};}for(var e in events){if(events[_0x477d('0x5')](e)){var event=events[e];UserProfile[_0x477d('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;