Changeset View
Changeset View
Standalone View
Standalone View
src/ref/build/ArcanistBuildRef.php
<?php | <?php | ||||
final class ArcanistBuildRef | final class ArcanistBuildRef | ||||
extends ArcanistRef | extends ArcanistRef { | ||||
implements | |||||
ArcanistDisplayRefInterface { | |||||
const HARDPOINT_BUILDPLANREF = 'ref.build.buildplanRef'; | const HARDPOINT_BUILDPLANREF = 'ref.build.buildplanRef'; | ||||
private $parameters; | private $parameters; | ||||
protected function newHardpoints() { | protected function newHardpoints() { | ||||
return array( | return array( | ||||
$this->newHardpoint(self::HARDPOINT_BUILDPLANREF), | $this->newHardpoint(self::HARDPOINT_BUILDPLANREF), | ||||
); | ); | ||||
} | } | ||||
public function getRefDisplayName() { | public function getRefDisplayName() { | ||||
return $this->getDisplayRefObjectName(); | return pht('Build %d', $this->getID()); | ||||
} | } | ||||
public static function newFromConduit(array $parameters) { | public static function newFromConduit(array $parameters) { | ||||
$ref = new self(); | $ref = new self(); | ||||
$ref->parameters = $parameters; | $ref->parameters = $parameters; | ||||
return $ref; | return $ref; | ||||
} | } | ||||
public function getID() { | public function getID() { | ||||
return idx($this->parameters, 'id'); | return idx($this->parameters, 'id'); | ||||
} | } | ||||
public function getPHID() { | public function getPHID() { | ||||
return idx($this->parameters, 'phid'); | return idx($this->parameters, 'phid'); | ||||
} | } | ||||
public function getName() { | public function getName() { | ||||
return idxv($this->parameters, array('fields', 'name')); | return idxv($this->parameters, array('fields', 'name')); | ||||
} | } | ||||
public function getDisplayRefObjectName() { | protected function buildRefView(ArcanistRefView $view) { | ||||
return pht('Build %d', $this->getID()); | $view | ||||
} | ->setObjectName($this->getRefDisplayName()) | ||||
->setTitle($this->getName()); | |||||
public function getDisplayRefTitle() { | |||||
return $this->getName(); | |||||
} | } | ||||
public function getBuildPlanRef() { | public function getBuildPlanRef() { | ||||
return $this->getHardpoint(self::HARDPOINT_BUILDPLANREF); | return $this->getHardpoint(self::HARDPOINT_BUILDPLANREF); | ||||
} | } | ||||
public function getBuildablePHID() { | public function getBuildablePHID() { | ||||
return idxv($this->parameters, array('fields', 'buildablePHID')); | return idxv($this->parameters, array('fields', 'buildablePHID')); | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |