示例#1
0
文件: Event.php 项目: hotrush/tracker
 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));
     }
 }
示例#2
0
 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));
     }
 }
示例#3
0
 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));
     }
 }