Built motion from commit 3c2ce842.|2.6.31
[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 _0x30b3=['remove','emit','hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x30b3,0x1e1));var _0x330b=function(_0xc2f54d,_0x242f6f){_0xc2f54d=_0xc2f54d-0x0;var _0x85900c=_0x30b3[_0xc2f54d];return _0x85900c;};'use strict';var EventEmitter=require(_0x330b('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x330b('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x330b('0x2')](0x0);var events={'afterCreate':_0x330b('0x3'),'afterUpdate':_0x330b('0x4'),'afterDestroy':_0x330b('0x5')};function emitEvent(_0x3bfafc){return function(_0xb95d38,_0x2d684c,_0x2a5d71){VoicePrefixEvents['emit'](_0x3bfafc+':'+_0xb95d38['id'],_0xb95d38);VoicePrefixEvents[_0x330b('0x6')](_0x3bfafc,_0xb95d38);_0x2a5d71(null);};}for(var e in events){if(events[_0x330b('0x7')](e)){var event=events[e];VoicePrefix[_0x330b('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;