name = $name; $this->message = $message; $this->title = $title; // Handle non-integer severity levels. if (!CRM_Utils_Rule::integer($level)) { $level = CRM_Utils_Check::severityMap($level); } $this->level = $level; } /** * @return string */ public function getName() { return $this->name; } /** * @return string */ public function getMessage() { return $this->message; } /** * @return string */ public function getTitle() { return $this->title; } /** * @return string * @see Psr\Log\LogLevel */ public function getLevel() { return $this->level; } /** * Alias for Level * @return string */ public function getSeverity() { return $this->getLevel(); } /** * Set optional additional help text * @param string $help */ public function addHelp($help) { $this->help = $help; } /** * @return array */ public function toArray() { $array = array( 'name' => $this->name, 'message' => $this->message, 'title' => $this->title, 'severity' => $this->level, ); if (!empty($this->help)) { $array['help'] = $this->help; } return $array; } }