Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/storage/PhabricatorProject.php
| Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | return array( | ||||
| 'hasMilestones' => 'bool', | 'hasMilestones' => 'bool', | ||||
| 'hasSubprojects' => 'bool', | 'hasSubprojects' => 'bool', | ||||
| 'milestoneNumber' => 'uint32?', | 'milestoneNumber' => 'uint32?', | ||||
| 'projectPath' => 'hashpath64', | 'projectPath' => 'hashpath64', | ||||
| 'projectDepth' => 'uint32', | 'projectDepth' => 'uint32', | ||||
| 'projectPathKey' => 'bytes4', | 'projectPathKey' => 'bytes4', | ||||
| ), | ), | ||||
| self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
| 'key_phid' => null, | |||||
| 'phid' => array( | |||||
| 'columns' => array('phid'), | |||||
| 'unique' => true, | |||||
| ), | |||||
| 'key_icon' => array( | 'key_icon' => array( | ||||
| 'columns' => array('icon'), | 'columns' => array('icon'), | ||||
| ), | ), | ||||
| 'key_color' => array( | 'key_color' => array( | ||||
| 'columns' => array('color'), | 'columns' => array('color'), | ||||
| ), | ), | ||||
| 'name' => array( | |||||
| 'columns' => array('name'), | |||||
| 'unique' => true, | |||||
| ), | |||||
| 'key_milestone' => array( | 'key_milestone' => array( | ||||
| 'columns' => array('parentProjectPHID', 'milestoneNumber'), | 'columns' => array('parentProjectPHID', 'milestoneNumber'), | ||||
| 'unique' => true, | 'unique' => true, | ||||
| ), | ), | ||||
| 'key_primaryslug' => array( | 'key_primaryslug' => array( | ||||
| 'columns' => array('primarySlug'), | 'columns' => array('primarySlug'), | ||||
| 'unique' => true, | 'unique' => true, | ||||
| ), | ), | ||||
| ▲ Show 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | final class PhabricatorProject extends PhabricatorProjectDAO | ||||
| public function supportsSubprojects() { | public function supportsSubprojects() { | ||||
| if ($this->isMilestone()) { | if ($this->isMilestone()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function loadNextMilestoneNumber() { | |||||
| $current = queryfx_one( | |||||
| $this->establishConnection('w'), | |||||
| 'SELECT MAX(milestoneNumber) n | |||||
| FROM %T | |||||
| WHERE parentProjectPHID = %s', | |||||
| $this->getTableName(), | |||||
| $this->getPHID()); | |||||
| if (!$current) { | |||||
| $number = 1; | |||||
| } else { | |||||
| $number = (int)$current['n'] + 1; | |||||
| } | |||||
| return $number; | |||||
| } | |||||
| /* -( PhabricatorSubscribableInterface )----------------------------------- */ | /* -( PhabricatorSubscribableInterface )----------------------------------- */ | ||||
| public function isAutomaticallySubscribed($phid) { | public function isAutomaticallySubscribed($phid) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||