0b234ee8c677cb5a23e5effafc0ea2606fb02783
[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 _0xeec2=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x13114d,_0x199cd5){var _0x49a026=function(_0x36343e){while(--_0x36343e){_0x13114d['push'](_0x13114d['shift']());}};_0x49a026(++_0x199cd5);}(_0xeec2,0x1c4));var _0x2eec=function(_0x3a7fbc,_0x382eee){_0x3a7fbc=_0x3a7fbc-0x0;var _0x481feb=_0xeec2[_0x3a7fbc];return _0x481feb;};'use strict';var EventEmitter=require(_0x2eec('0x0'));var VoicePrefix=require(_0x2eec('0x1'))['db'][_0x2eec('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2eec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2eec('0x4'),'afterDestroy':_0x2eec('0x5')};function emitEvent(_0x68408f){return function(_0x235abb,_0x1a8d86,_0x35bc33){VoicePrefixEvents[_0x2eec('0x6')](_0x68408f+':'+_0x235abb['id'],_0x235abb);VoicePrefixEvents[_0x2eec('0x6')](_0x68408f,_0x235abb);_0x35bc33(null);};}for(var e in events){if(events[_0x2eec('0x7')](e)){var event=events[e];VoicePrefix[_0x2eec('0x8')](e,emitEvent(event));}}module[_0x2eec('0x9')]=VoicePrefixEvents;