Built motion from commit 25580385.|2.6.2
[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 _0x0ebb=['hook','exports','../../mysqldb','VoicePrefix','update','emit','hasOwnProperty'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0x0ebb,0x6b));var _0xb0eb=function(_0x412e68,_0x8d2687){_0x412e68=_0x412e68-0x0;var _0x5cf112=_0x0ebb[_0x412e68];return _0x5cf112;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xb0eb('0x0'))['db'][_0xb0eb('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0eb('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1ec741){return function(_0x4b002c,_0x243b61,_0x47b031){VoicePrefixEvents['emit'](_0x1ec741+':'+_0x4b002c['id'],_0x4b002c);VoicePrefixEvents[_0xb0eb('0x3')](_0x1ec741,_0x4b002c);_0x47b031(null);};}for(var e in events){if(events[_0xb0eb('0x4')](e)){var event=events[e];VoicePrefix[_0xb0eb('0x5')](e,emitEvent(event));}}module[_0xb0eb('0x6')]=VoicePrefixEvents;