Built motion from commit (unavailable).|2.5.11
[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 _0x1af3=['../../mysqldb','UserProfile','update','remove','emit','hook'];(function(_0xa9937f,_0x314462){var _0x14a138=function(_0x5bf5b3){while(--_0x5bf5b3){_0xa9937f['push'](_0xa9937f['shift']());}};_0x14a138(++_0x314462);}(_0x1af3,0x12c));var _0x31af=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x1af3[_0x3f8282];return _0x50f918;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x31af('0x0'))['db'][_0x31af('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x31af('0x2'),'afterDestroy':_0x31af('0x3')};function emitEvent(_0x394f43){return function(_0x4563ba,_0x58ee6c,_0x352540){UserProfileEvents[_0x31af('0x4')](_0x394f43+':'+_0x4563ba['id'],_0x4563ba);UserProfileEvents['emit'](_0x394f43,_0x4563ba);_0x352540(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x31af('0x5')](e,emitEvent(event));}}module['exports']=UserProfileEvents;