report->add(new Report( $type, $message )); } /** * Get last test takers event from delivery log * @param DeliveryExecution $deliveryExecution * @return array|null * @throws */ protected function getLastTestTakersEvent(DeliveryExecution $deliveryExecution) { /** @var DeliveryLog $deliveryLogService */ $deliveryLogService = $this->getServiceLocator()->get(DeliveryLog::SERVICE_ID); $events = $deliveryLogService->search( [ DeliveryLog::DELIVERY_EXECUTION_ID => $deliveryExecution->getIdentifier(), DeliveryLog::CREATED_BY => $deliveryExecution->getUserIdentifier() ], ['limit' => 1, 'order' => DeliveryLog::ID, 'dir' => 'DESC'] ); $lastTestTakersEvent = null; if (!empty($events[0])) { $lastTestTakersEvent = $events[0]; } return $lastTestTakersEvent; } }