Built motion from commit (unavailable).|2.4.17
[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 _0xf835=['events','UserProfile','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x159a20,_0x15be1b){var _0x5cb55d=function(_0x186453){while(--_0x186453){_0x159a20['push'](_0x159a20['shift']());}};_0x5cb55d(++_0x15be1b);}(_0xf835,0x180));var _0x5f83=function(_0x3c3770,_0x4c379f){_0x3c3770=_0x3c3770-0x0;var _0x589b82=_0xf835[_0x3c3770];return _0x589b82;};'use strict';var EventEmitter=require(_0x5f83('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x5f83('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5f83('0x2'),'afterDestroy':_0x5f83('0x3')};function emitEvent(_0x5113ff){return function(_0x26b995,_0x1b2698,_0x364f8f){UserProfileEvents[_0x5f83('0x4')](_0x5113ff+':'+_0x26b995['id'],_0x26b995);UserProfileEvents[_0x5f83('0x4')](_0x5113ff,_0x26b995);_0x364f8f(null);};}for(var e in events){if(events[_0x5f83('0x5')](e)){var event=events[e];UserProfile[_0x5f83('0x6')](e,emitEvent(event));}}module[_0x5f83('0x7')]=UserProfileEvents;