63f0d3062ddb0b1c884d997da0f86d51a6db672e
[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 _0xd039=['../../mysqldb','setMaxListeners','update','hook'];(function(_0x2ae261,_0x3fec4e){var _0x35fb7e=function(_0x39bace){while(--_0x39bace){_0x2ae261['push'](_0x2ae261['shift']());}};_0x35fb7e(++_0x3fec4e);}(_0xd039,0xe0));var _0x9d03=function(_0x4b2772,_0xec4e01){_0x4b2772=_0x4b2772-0x0;var _0x3f0f69=_0xd039[_0x4b2772];return _0x3f0f69;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9d03('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9d03('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9d03('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1fc87e){return function(_0x1e6f71,_0x53c8ad,_0x783589){UserProfileEvents['emit'](_0x1fc87e+':'+_0x1e6f71['id'],_0x1e6f71);UserProfileEvents['emit'](_0x1fc87e,_0x1e6f71);_0x783589(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x9d03('0x3')](e,emitEvent(event));}}module['exports']=UserProfileEvents;