private function logEvent($event) { $evenId = $event['event'] ? $this->findOrCreate(array('name' => $event['event']), array('name')) : null; $classId = $this->getObject($event['object']) ? $this->systemClassRepository->findOrCreate(array('name' => $this->getObject($event['object'])), array('name')) : null; if ($evenId) { $this->eventLogRepository->create(array('log_id' => $this->logRepository->getCurrentLogId(), 'event_id' => $evenId, 'class_id' => $classId)); } }
private function logEvent($event) { file_put_contents('/tmp/event.txt', $this->eventStorage->isOn() ? 'on' : 'off' . ' - event = ' . $event['event'] . ' -- object = ' . $this->getObject($event['object']) . "\n", FILE_APPEND); $evenId = $event['event'] ? $this->findOrCreate(array('name' => $event['event']), array('name')) : null; $classId = $this->getObject($event['object']) ? $this->systemClassRepository->findOrCreate(array('name' => $this->getObject($event['object'])), array('name')) : null; if ($evenId) { $this->eventLogRepository->create(array('log_id' => $this->logRepository->getCurrentLogId(), 'event_id' => $evenId, 'class_id' => $classId)); } }
public function logEvent($event) { $event = $this->makeEventArray($event); $evenId = $this->getEventId($event); if ($evenId) { $objectName = $this->getObjectName($event); $classId = $this->getClassId($objectName); $this->eventLogRepository->create(array('log_id' => $this->logRepository->getCurrentLogId(), 'event_id' => $evenId, 'class_id' => $classId)); } }