1f3533de17ca17985130572414b62de4b5adbeea
[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 _0x4dea=['remove','emit','hook','exports','events','../../mysqldb','VoicePrefix','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4dea,0x1f4));var _0xa4de=function(_0x3828cd,_0x5d8750){_0x3828cd=_0x3828cd-0x0;var _0x1fbcbb=_0x4dea[_0x3828cd];return _0x1fbcbb;};'use strict';var EventEmitter=require(_0xa4de('0x0'));var VoicePrefix=require(_0xa4de('0x1'))['db'][_0xa4de('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa4de('0x3'),'afterDestroy':_0xa4de('0x4')};function emitEvent(_0x37371b){return function(_0x43ab2d,_0x521b89,_0x3c2013){VoicePrefixEvents[_0xa4de('0x5')](_0x37371b+':'+_0x43ab2d['id'],_0x43ab2d);VoicePrefixEvents[_0xa4de('0x5')](_0x37371b,_0x43ab2d);_0x3c2013(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xa4de('0x6')](e,emitEvent(event));}}module[_0xa4de('0x7')]=VoicePrefixEvents;