Built motion from commit 85328c08.|2.5.50
[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 _0xa498=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0xa498,0x1d6));var _0x8a49=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xa498[_0x1acc2d];return _0xabfa6d;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8a49('0x0'))['db'][_0x8a49('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a49('0x2'),'afterDestroy':_0x8a49('0x3')};function emitEvent(_0x1d4dd2){return function(_0x65eb15,_0x2f362e,_0x5aaf52){UserProfileEvents[_0x8a49('0x4')](_0x1d4dd2+':'+_0x65eb15['id'],_0x65eb15);UserProfileEvents['emit'](_0x1d4dd2,_0x65eb15);_0x5aaf52(null);};}for(var e in events){if(events[_0x8a49('0x5')](e)){var event=events[e];UserProfile[_0x8a49('0x6')](e,emitEvent(event));}}module[_0x8a49('0x7')]=UserProfileEvents;