Differential D20220 Diff 48333 src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php
| Show All 11 Lines | implements | ||||
| PhabricatorConduitResultInterface, | PhabricatorConduitResultInterface, | ||||
| PhabricatorProjectInterface { | PhabricatorProjectInterface { | ||||
| protected $name; | protected $name; | ||||
| protected $planStatus; | protected $planStatus; | ||||
| protected $planAutoKey; | protected $planAutoKey; | ||||
| protected $viewPolicy; | protected $viewPolicy; | ||||
| protected $editPolicy; | protected $editPolicy; | ||||
| protected $properties = array(); | |||||
| const STATUS_ACTIVE = 'active'; | const STATUS_ACTIVE = 'active'; | ||||
| const STATUS_DISABLED = 'disabled'; | const STATUS_DISABLED = 'disabled'; | ||||
| private $buildSteps = self::ATTACHABLE; | private $buildSteps = self::ATTACHABLE; | ||||
| public static function initializeNewBuildPlan(PhabricatorUser $actor) { | public static function initializeNewBuildPlan(PhabricatorUser $actor) { | ||||
| $app = id(new PhabricatorApplicationQuery()) | $app = id(new PhabricatorApplicationQuery()) | ||||
| Show All 12 Lines | return id(new HarbormasterBuildPlan()) | ||||
| ->attachBuildSteps(array()) | ->attachBuildSteps(array()) | ||||
| ->setViewPolicy($view_policy) | ->setViewPolicy($view_policy) | ||||
| ->setEditPolicy($edit_policy); | ->setEditPolicy($edit_policy); | ||||
| } | } | ||||
| protected function getConfiguration() { | protected function getConfiguration() { | ||||
| return array( | return array( | ||||
| self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
| self::CONFIG_SERIALIZATION => array( | |||||
| 'properties' => self::SERIALIZATION_JSON, | |||||
| ), | |||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| 'name' => 'sort128', | 'name' => 'sort128', | ||||
| 'planStatus' => 'text32', | 'planStatus' => 'text32', | ||||
| 'planAutoKey' => 'text32?', | 'planAutoKey' => 'text32?', | ||||
| ), | ), | ||||
| self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
| 'key_status' => array( | 'key_status' => array( | ||||
| 'columns' => array('planStatus'), | 'columns' => array('planStatus'), | ||||
| Show All 33 Lines | return urisprintf( | ||||
| '/harbormaster/plan/%s/', | '/harbormaster/plan/%s/', | ||||
| $this->getID()); | $this->getID()); | ||||
| } | } | ||||
| public function getObjectName() { | public function getObjectName() { | ||||
| return pht('Plan %d', $this->getID()); | return pht('Plan %d', $this->getID()); | ||||
| } | } | ||||
| public function getPlanProperty($key, $default = null) { | |||||
| return idx($this->properties, $key, $default); | |||||
| } | |||||
| public function setPlanProperty($key, $value) { | |||||
| $this->properties[$key] = $value; | |||||
| return $this; | |||||
| } | |||||
| /* -( Autoplans )---------------------------------------------------------- */ | /* -( Autoplans )---------------------------------------------------------- */ | ||||
| public function isAutoplan() { | public function isAutoplan() { | ||||
| return ($this->getPlanAutoKey() !== null); | return ($this->getPlanAutoKey() !== null); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines | |||||