Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/HarbormasterBuildable.php
<?php | <?php | ||||
final class HarbormasterBuildable | final class HarbormasterBuildable | ||||
extends HarbormasterDAO | extends HarbormasterDAO | ||||
implements | implements | ||||
PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
HarbormasterBuildableInterface, | HarbormasterBuildableInterface, | ||||
PhabricatorConduitResultInterface, | |||||
PhabricatorDestructibleInterface { | PhabricatorDestructibleInterface { | ||||
protected $buildablePHID; | protected $buildablePHID; | ||||
protected $containerPHID; | protected $containerPHID; | ||||
protected $buildableStatus; | protected $buildableStatus; | ||||
protected $isManualBuildable; | protected $isManualBuildable; | ||||
private $buildableObject = self::ATTACHABLE; | private $buildableObject = self::ATTACHABLE; | ||||
▲ Show 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | public function getAvailableBuildVariables() { | ||||
return array(); | return array(); | ||||
} | } | ||||
public function newBuildableEngine() { | public function newBuildableEngine() { | ||||
return $this->getBuildableObject()->newBuildableEngine(); | return $this->getBuildableObject()->newBuildableEngine(); | ||||
} | } | ||||
/* -( PhabricatorConduitResultInterface )---------------------------------- */ | |||||
public function getFieldSpecificationsForConduit() { | |||||
return array( | |||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('objectPHID') | |||||
->setType('phid') | |||||
->setDescription(pht('PHID of the object that is built.')), | |||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('containerPHID') | |||||
->setType('phid') | |||||
->setDescription(pht('PHID of the object containing this buildable.')), | |||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('buildableStatus') | |||||
->setType('map<string, wild>') | |||||
epriestley: Make this a `map<string, wild>`... | |||||
->setDescription(pht('The current status of this buildable.')), | |||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('isManual') | |||||
->setType('bool') | |||||
->setDescription(pht('True if this is a manual buildable.')), | |||||
); | |||||
} | |||||
public function getFieldValuesForConduit() { | |||||
return array( | |||||
'objectPHID' => $this->getBuildablePHID(), | |||||
'containerPHID' => $this->getContainerPHID(), | |||||
'buildableStatus' => array( | |||||
Not Done Inline Actions...and this an array, like: 'buildableStatus' => array( 'value' => $this->getBuildableStatus(), ), See HarbormasterBuild for an example. This lets us add a name (human-readable, translatable name) too, and statuses tend to pick up other attributes sooner or later (like color.ansi for letting arc render the status without arc needing to know what all the possible values are). (We could do this with a separate harbormaster.buildable.status.search but that's relatively cumbersome and just putting the data on the object feels like it strikes a better practical balance.) epriestley: ...and this an array, like:
```
'buildableStatus' => array(
'value' => $this… | |||||
'value' => $this->getBuildableStatus(), | |||||
), | |||||
'isManual' => (bool)$this->getIsManualBuildable(), | |||||
); | |||||
} | |||||
public function getConduitSearchAttachments() { | |||||
return array(); | |||||
} | |||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */ | /* -( PhabricatorDestructibleInterface )----------------------------------- */ | ||||
public function destroyObjectPermanently( | public function destroyObjectPermanently( | ||||
PhabricatorDestructionEngine $engine) { | PhabricatorDestructionEngine $engine) { | ||||
$viewer = $engine->getViewer(); | $viewer = $engine->getViewer(); | ||||
$this->openTransaction(); | $this->openTransaction(); | ||||
Show All 21 Lines |
Make this a map<string, wild>...