Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / squareProject / squareProject.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 _0x7ac1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x1efa71,_0x4bbcd2){var _0x361eaa=function(_0x45b3fd){while(--_0x45b3fd){_0x1efa71['push'](_0x1efa71['shift']());}};_0x361eaa(++_0x4bbcd2);}(_0x7ac1,0x149));var _0x17ac=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7ac1[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x17ac('0x0'));var SquareProject=require(_0x17ac('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x17ac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17ac('0x3'),'afterDestroy':_0x17ac('0x4')};function emitEvent(_0x54a519){return function(_0x587302,_0x2c764d,_0x2587a2){SquareProjectEvents[_0x17ac('0x5')](_0x54a519+':'+_0x587302['id'],_0x587302);SquareProjectEvents[_0x17ac('0x5')](_0x54a519,_0x587302);_0x2587a2(null);};}for(var e in events){if(events[_0x17ac('0x6')](e)){var event=events[e];SquareProject[_0x17ac('0x7')](e,emitEvent(event));}}module[_0x17ac('0x8')]=SquareProjectEvents;