Built motion from commit f25620e4.|2.6.30
[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 _0xa809=['save','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa809,0x1f3));var _0x9a80=function(_0x329eef,_0x1d6364){_0x329eef=_0x329eef-0x0;var _0x5a1b7f=_0xa809[_0x329eef];return _0x5a1b7f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9a80('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a80('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5e516a){return function(_0x2b07d5,_0x1f3715,_0x183098){UserProfileEvents[_0x9a80('0x2')](_0x5e516a+':'+_0x2b07d5['id'],_0x2b07d5);UserProfileEvents['emit'](_0x5e516a,_0x2b07d5);_0x183098(null);};}for(var e in events){if(events[_0x9a80('0x3')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9a80('0x4')]=UserProfileEvents;