Built motion from commit 9d0783e6.|2.6.13
[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 _0xb768=['remove','emit','hasOwnProperty','hook','../../mysqldb','VoicePrefix','setMaxListeners','update'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xb768,0x1cc));var _0x8b76=function(_0x49b722,_0x2eb6c0){_0x49b722=_0x49b722-0x0;var _0xa8507f=_0xb768[_0x49b722];return _0xa8507f;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x8b76('0x0'))['db'][_0x8b76('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8b76('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b76('0x3'),'afterDestroy':_0x8b76('0x4')};function emitEvent(_0x37b04d){return function(_0x53fd6c,_0xafdc85,_0x1086c4){VoicePrefixEvents[_0x8b76('0x5')](_0x37b04d+':'+_0x53fd6c['id'],_0x53fd6c);VoicePrefixEvents[_0x8b76('0x5')](_0x37b04d,_0x53fd6c);_0x1086c4(null);};}for(var e in events){if(events[_0x8b76('0x6')](e)){var event=events[e];VoicePrefix[_0x8b76('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;