Built motion from commit e38a297d.|2.6.18
[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 _0x8518=['hook','exports','events','remove','emit','hasOwnProperty'];(function(_0x4aec3f,_0x2de89f){var _0x4f10cc=function(_0x325664){while(--_0x325664){_0x4aec3f['push'](_0x4aec3f['shift']());}};_0x4f10cc(++_0x2de89f);}(_0x8518,0x12e));var _0x8851=function(_0x1d6d5f,_0x195b5b){_0x1d6d5f=_0x1d6d5f-0x0;var _0x54420b=_0x8518[_0x1d6d5f];return _0x54420b;};'use strict';var EventEmitter=require(_0x8851('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8851('0x1')};function emitEvent(_0x2ee0f0){return function(_0x2fde55,_0x29d8f5,_0x276344){VoicePrefixEvents[_0x8851('0x2')](_0x2ee0f0+':'+_0x2fde55['id'],_0x2fde55);VoicePrefixEvents[_0x8851('0x2')](_0x2ee0f0,_0x2fde55);_0x276344(null);};}for(var e in events){if(events[_0x8851('0x3')](e)){var event=events[e];VoicePrefix[_0x8851('0x4')](e,emitEvent(event));}}module[_0x8851('0x5')]=VoicePrefixEvents;