Differential D7368 Diff 16627 src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php
- This file was added.
<?php | |||||
final class HarbormasterBuildPlan extends HarbormasterDAO | |||||
implements | |||||
PhabricatorPolicyInterface, | |||||
PhabricatorSubscribableInterface { | |||||
protected $name; | |||||
protected $planStatus; | |||||
private $buildSteps = self::ATTACHABLE; | |||||
public static function initializeNewBuildPlan(PhabricatorUser $actor) { | |||||
return id(new HarbormasterBuildPlan()) | |||||
->setPlanStatus('active'); // TODO: Figure this out. | |||||
} | |||||
public function getConfiguration() { | |||||
return array( | |||||
self::CONFIG_AUX_PHID => true, | |||||
) + parent::getConfiguration(); | |||||
} | |||||
public function generatePHID() { | |||||
return PhabricatorPHID::generateNewPHID( | |||||
HarbormasterPHIDTypeBuildPlan::TYPECONST); | |||||
} | |||||
public function attachBuildSteps(array $steps) { | |||||
assert_instances_of($steps, 'HarbormasterBuildStep'); | |||||
$this->buildSteps = $steps; | |||||
return $this; | |||||
} | |||||
public function getBuildSteps() { | |||||
return $this->assertAttached($this->buildSteps); | |||||
} | |||||
/* -( PhabricatorSubscribableInterface )----------------------------------- */ | |||||
public function isAutomaticallySubscribed($phid) { | |||||
return false; | |||||
} | |||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */ | |||||
public function getCapabilities() { | |||||
return array( | |||||
PhabricatorPolicyCapability::CAN_VIEW, | |||||
); | |||||
} | |||||
public function getPolicy($capability) { | |||||
switch ($capability) { | |||||
case PhabricatorPolicyCapability::CAN_VIEW: | |||||
return PhabricatorPolicies::getMostOpenPolicy(); | |||||
} | |||||
} | |||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | |||||
return false; | |||||
} | |||||
public function describeAutomaticCapability($capability) { | |||||
return null; | |||||
} | |||||
} |