Built motion from commit da617fac.|2.6.6
[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 _0x4b7a=['hasOwnProperty','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x1d7c10,_0x3b5ed7){var _0xb76ec7=function(_0x520c1c){while(--_0x520c1c){_0x1d7c10['push'](_0x1d7c10['shift']());}};_0xb76ec7(++_0x3b5ed7);}(_0x4b7a,0x7f));var _0xa4b7=function(_0x1952ac,_0x5c7345){_0x1952ac=_0x1952ac-0x0;var _0x15abe5=_0x4b7a[_0x1952ac];return _0x15abe5;};'use strict';var EventEmitter=require(_0xa4b7('0x0'));var VoicePrefix=require(_0xa4b7('0x1'))['db'][_0xa4b7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa4b7('0x3')](0x0);var events={'afterCreate':_0xa4b7('0x4'),'afterUpdate':_0xa4b7('0x5'),'afterDestroy':_0xa4b7('0x6')};function emitEvent(_0x3483b2){return function(_0x149e40,_0x4dcd1b,_0x5878bb){VoicePrefixEvents[_0xa4b7('0x7')](_0x3483b2+':'+_0x149e40['id'],_0x149e40);VoicePrefixEvents[_0xa4b7('0x7')](_0x3483b2,_0x149e40);_0x5878bb(null);};}for(var e in events){if(events[_0xa4b7('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;