860b43a274b1182d76d3bea4b71033ede9a79b62
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0xf25b=['VoicePrefix','update','remove','emit','hook','events','../../mysqldb'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xf25b,0xf3));var _0xbf25=function(_0x435891,_0xc53f9e){_0x435891=_0x435891-0x0;var _0x593fa7=_0xf25b[_0x435891];return _0x593fa7;};'use strict';var EventEmitter=require(_0xbf25('0x0'));var VoicePrefix=require(_0xbf25('0x1'))['db'][_0xbf25('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf25('0x3'),'afterDestroy':_0xbf25('0x4')};function emitEvent(_0x48f56f){return function(_0x3b598b,_0x482727,_0x5294e3){VoicePrefixEvents[_0xbf25('0x5')](_0x48f56f+':'+_0x3b598b['id'],_0x3b598b);VoicePrefixEvents[_0xbf25('0x5')](_0x48f56f,_0x3b598b);_0x5294e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xbf25('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;