Built motion from commit 753c950e.|2.5.42
[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 _0x40b7=['VoicePrefix','setMaxListeners','update','remove','emit','hook','exports'];(function(_0xb5af47,_0x1c6ce6){var _0x1542ad=function(_0x5f15bc){while(--_0x5f15bc){_0xb5af47['push'](_0xb5af47['shift']());}};_0x1542ad(++_0x1c6ce6);}(_0x40b7,0x93));var _0x740b=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x40b7[_0x1b7368];return _0x25d54c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x740b('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x740b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x740b('0x2'),'afterDestroy':_0x740b('0x3')};function emitEvent(_0x120a92){return function(_0x500d0b,_0x4319d7,_0x280215){VoicePrefixEvents[_0x740b('0x4')](_0x120a92+':'+_0x500d0b['id'],_0x500d0b);VoicePrefixEvents[_0x740b('0x4')](_0x120a92,_0x500d0b);_0x280215(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x740b('0x5')](e,emitEvent(event));}}module[_0x740b('0x6')]=VoicePrefixEvents;