Built motion from commit a61a4a20.|2.5.46
[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 _0x82b9=['hasOwnProperty','exports','VoicePrefix','setMaxListeners','update','emit'];(function(_0x3a4473,_0x1d03fe){var _0xb617ba=function(_0x2d7ec6){while(--_0x2d7ec6){_0x3a4473['push'](_0x3a4473['shift']());}};_0xb617ba(++_0x1d03fe);}(_0x82b9,0x1d6));var _0x982b=function(_0x1c53f6,_0x30f906){_0x1c53f6=_0x1c53f6-0x0;var _0x2fd971=_0x82b9[_0x1c53f6];return _0x2fd971;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x982b('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x982b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x982b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2cd36e){return function(_0x4c3300,_0x444c10,_0x38c5a4){VoicePrefixEvents[_0x982b('0x3')](_0x2cd36e+':'+_0x4c3300['id'],_0x4c3300);VoicePrefixEvents[_0x982b('0x3')](_0x2cd36e,_0x4c3300);_0x38c5a4(null);};}for(var e in events){if(events[_0x982b('0x4')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x982b('0x5')]=VoicePrefixEvents;