0b4bf822e6decb1041a98ca56a5f62c3ec2b8d77
[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 _0xbae0=['exports','events','VoicePrefix','setMaxListeners','save','update','remove','hook'];(function(_0x592541,_0x4fab31){var _0x5ba8d8=function(_0xd62b60){while(--_0xd62b60){_0x592541['push'](_0x592541['shift']());}};_0x5ba8d8(++_0x4fab31);}(_0xbae0,0x171));var _0x0bae=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0xbae0[_0x1830ce];return _0x2bce9f;};'use strict';var EventEmitter=require(_0x0bae('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x0bae('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0bae('0x2')](0x0);var events={'afterCreate':_0x0bae('0x3'),'afterUpdate':_0x0bae('0x4'),'afterDestroy':_0x0bae('0x5')};function emitEvent(_0x500485){return function(_0xacafb1,_0x1f64c8,_0x4fbca2){VoicePrefixEvents['emit'](_0x500485+':'+_0xacafb1['id'],_0xacafb1);VoicePrefixEvents['emit'](_0x500485,_0xacafb1);_0x4fbca2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x0bae('0x6')](e,emitEvent(event));}}module[_0x0bae('0x7')]=VoicePrefixEvents;