Path: blob/master/src/applications/harbormaster/exception/HarbormasterMessageException.php
12256 views
<?php12final class HarbormasterMessageException extends Exception {34private $title;5private $body = array();67public function __construct($title, $body = null) {8$this->setTitle($title);9$this->appendParagraph($body);1011parent::__construct(12pht(13'%s: %s',14$title,15$body));16}1718public function setTitle($title) {19$this->title = $title;20return $this;21}2223public function getTitle() {24return $this->title;25}2627public function appendParagraph($description) {28$this->body[] = $description;29return $this;30}3132public function getBody() {33return $this->body;34}3536public function newDisplayString() {37$title = $this->getTitle();3839$body = $this->getBody();40$body = implode("\n\n", $body);4142return pht('%s: %s', $title, $body);43}4445}464748