Differential D21565 Diff 51350 src/applications/herald/storage/transcript/HeraldTranscriptResult.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/storage/transcript/HeraldTranscriptResult.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | abstract class HeraldTranscriptResult | ||||
final public function getIconColor() { | final public function getIconColor() { | ||||
return $this->getSpecificationProperty('color.icon'); | return $this->getSpecificationProperty('color.icon'); | ||||
} | } | ||||
final public function getName() { | final public function getName() { | ||||
return $this->getSpecificationProperty('name'); | return $this->getSpecificationProperty('name'); | ||||
} | } | ||||
final protected function getDataProperty($key) { | abstract public function newDetailsView(PhabricatorUser $viewer); | ||||
final protected function getDataProperty($key, $default = null) { | |||||
$data = $this->getResultData(); | $data = $this->getResultData(); | ||||
return idx($data, $key); | return idx($data, $key, $default); | ||||
} | } | ||||
final public function newResultMap() { | final public function newResultMap() { | ||||
return array( | return array( | ||||
'code' => $this->getResultCode(), | 'code' => $this->getResultCode(), | ||||
'data' => $this->getResultData(), | 'data' => $this->getResultData(), | ||||
); | ); | ||||
} | } | ||||
Show All 13 Lines | if (!isset($map[$result_code])) { | ||||
$result_code)); | $result_code)); | ||||
} | } | ||||
return $map[$result_code]; | return $map[$result_code]; | ||||
} | } | ||||
abstract protected function newResultSpecificationMap(); | abstract protected function newResultSpecificationMap(); | ||||
final protected function newErrorView($error_class, $error_message) { | |||||
return pht( | |||||
'%s: %s', | |||||
phutil_tag('strong', array(), $error_class), | |||||
phutil_escape_html_newlines($error_message)); | |||||
} | |||||
} | } |