report = $report; } /** * Return the report * * @return \common_report_Report */ public function getReport() { return $this->report; } /** * Extract all report messages to simple array * * @return array */ public function getReportMessages() { $messages = []; /** @var \common_report_Report $subReport */ foreach ($this->report as $subReport) { $errors = []; if ($subReport->containsError()) { $errors = $subReport->getErrors(); } $messages[] = [ 'message' => $subReport->getMessage(), 'details' => $errors ]; } return $messages; } }