1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x0b0e=['Plugin','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x567856,_0x50ec73){var _0x3ded8b=function(_0x9ea47e){while(--_0x9ea47e){_0x567856['push'](_0x567856['shift']());}};_0x3ded8b(++_0x50ec73);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47bc58,_0x1e1998){_0x47bc58=_0x47bc58-0x0;var _0x4a0860=_0x0b0e[_0x47bc58];return _0x4a0860;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var Plugin=require('../../mysqldb')['db'][_0xe0b0('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){PluginEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);PluginEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];Plugin[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;