protected function _fakeWatcherAuditLog($model) { $params = $model->params; $params = array_intersect_key($params, array_fill_keys(AuditLogFilterFields::getWhiteList(), 1)); $filterList = AuditLogService::getInstance()->buildFilterList($params); $watcher = $this->getMapper()->constructWatcherToTransaction(); $watcher->entityType = 'report'; $txId = uniqid('report-'); $watcher->entityIds = array($txId); $watcher->params->reportType = "audit_log"; $watcher->params->params = $params; $watcher->params->fileName = "report-audit.csv"; $watcher->remove = strtotime(\App::config('reports.autoremove', "+1 year")); $this->createWatcher($watcher); $event = $this->getMapper()->constructEventToTransaction(); $event->entityType = 'report'; $event->entityId = $txId; WatcherService::getInstance()->publishEvent($event); return $watcher->reload(); }
/** * */ public function init() { $this->_auditLogSrv = \Application\Service\AuditLogService::getInstance(); }