Changeset View
Changeset View
Standalone View
Standalone View
src/ref/user/ArcanistUserRef.php
| <?php | <?php | ||||
| final class ArcanistUserRef | final class ArcanistUserRef | ||||
| extends ArcanistRef | extends ArcanistRef { | ||||
| implements | |||||
| ArcanistDisplayRefInterface { | |||||
| private $parameters; | private $parameters; | ||||
| public function getRefDisplayName() { | public function getRefDisplayName() { | ||||
| return pht('User "%s"', $this->getMonogram()); | return pht('User "%s"', $this->getMonogram()); | ||||
| } | } | ||||
| public static function newFromConduit(array $parameters) { | public static function newFromConduit(array $parameters) { | ||||
| Show All 29 Lines | final class ArcanistUserRef | ||||
| public function getUsername() { | public function getUsername() { | ||||
| return idxv($this->parameters, array('fields', 'username')); | return idxv($this->parameters, array('fields', 'username')); | ||||
| } | } | ||||
| public function getRealName() { | public function getRealName() { | ||||
| return idxv($this->parameters, array('fields', 'realName')); | return idxv($this->parameters, array('fields', 'realName')); | ||||
| } | } | ||||
| public function getDisplayRefObjectName() { | protected function buildRefView(ArcanistRefView $view) { | ||||
| return $this->getMonogram(); | |||||
| } | |||||
| public function getDisplayRefTitle() { | |||||
| $real_name = $this->getRealName(); | $real_name = $this->getRealName(); | ||||
| if (strlen($real_name)) { | if (strlen($real_name)) { | ||||
| $real_name = sprintf('(%s)', $real_name); | $real_name = sprintf('(%s)', $real_name); | ||||
| } | } | ||||
| return $real_name; | $view | ||||
| ->setObjectName($this->getMonogram()) | |||||
| ->setTitle($real_name); | |||||
| } | } | ||||
| } | } | ||||