Built motion from commit 616d3211.|2.6.4
[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 _0x935b=['update','emit','hasOwnProperty','exports','VoicePrefix'];(function(_0x503254,_0x29e551){var _0x383dcc=function(_0x3c27fb){while(--_0x3c27fb){_0x503254['push'](_0x503254['shift']());}};_0x383dcc(++_0x29e551);}(_0x935b,0x176));var _0xb935=function(_0x326f73,_0x2fe326){_0x326f73=_0x326f73-0x0;var _0x4fee96=_0x935b[_0x326f73];return _0x4fee96;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0xb935('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb935('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4de7f5){return function(_0x2095a1,_0x3331e1,_0x5bf5f8){VoicePrefixEvents[_0xb935('0x2')](_0x4de7f5+':'+_0x2095a1['id'],_0x2095a1);VoicePrefixEvents[_0xb935('0x2')](_0x4de7f5,_0x2095a1);_0x5bf5f8(null);};}for(var e in events){if(events[_0xb935('0x3')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xb935('0x4')]=VoicePrefixEvents;