public function save()
 {
     $result = parent::save();
     if ($this->subprojectsNeedUpdate) {
         // If we've changed the project PHIDs for this task, update the link
         // table.
         PhabricatorProjectSubproject::updateProjectSubproject($this);
         $this->subprojectsNeedUpdate = false;
     }
     return $result;
 }
 public function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('properties' => self::SERIALIZATION_JSON)) + parent::getConfiguration();
 }
 public function save()
 {
     if (!$this->getMailKey()) {
         $this->setMailKey(Filesystem::readRandomCharacters(20));
     }
     if (!strlen($this->getPHID())) {
         $this->setPHID($this->generatePHID());
     }
     if (!strlen($this->getProjectPathKey())) {
         $hash = PhabricatorHash::digestForIndex($this->getPHID());
         $hash = substr($hash, 0, 4);
         $this->setProjectPathKey($hash);
     }
     $path = array();
     $depth = 0;
     if ($this->parentProjectPHID) {
         $parent = $this->getParentProject();
         $path[] = $parent->getProjectPath();
         $depth = $parent->getProjectDepth() + 1;
     }
     $path[] = $this->getProjectPathKey();
     $path = implode('', $path);
     $limit = self::getProjectDepthLimit();
     if ($depth >= $limit) {
         throw new Exception(pht('Project depth is too great.'));
     }
     $this->setProjectPath($path);
     $this->setProjectDepth($depth);
     $this->openTransaction();
     $result = parent::save();
     $this->updateDatasourceTokens();
     $this->saveTransaction();
     return $result;
 }
示例#4
0
 public function save()
 {
     if (!$this->getMailKey()) {
         $this->setMailKey(Filesystem::readRandomCharacters(20));
     }
     $this->openTransaction();
     $result = parent::save();
     $this->updateDatasourceTokens();
     $this->saveTransaction();
     return $result;
 }
 protected function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('properties' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('name' => 'text255', 'status' => 'uint32', 'sequence' => 'uint32', 'proxyPHID' => 'phid?'), self::CONFIG_KEY_SCHEMA => array('key_status' => array('columns' => array('projectPHID', 'status', 'sequence')), 'key_sequence' => array('columns' => array('projectPHID', 'sequence')), 'key_proxy' => array('columns' => array('projectPHID', 'proxyPHID'), 'unique' => true))) + parent::getConfiguration();
 }
 protected function getConfiguration()
 {
     return array(self::CONFIG_TIMESTAMPS => false, self::CONFIG_COLUMN_SCHEMA => array('sequence' => 'uint32'), self::CONFIG_KEY_SCHEMA => array('boardPHID' => array('columns' => array('boardPHID', 'columnPHID', 'objectPHID'), 'unique' => true), 'objectPHID' => array('columns' => array('objectPHID', 'boardPHID')), 'boardPHID_2' => array('columns' => array('boardPHID', 'columnPHID', 'sequence')))) + parent::getConfiguration();
 }
 public function getConfiguration()
 {
     return array(self::CONFIG_TIMESTAMPS => false) + parent::getConfiguration();
 }
 public function getConfiguration()
 {
     return array(self::CONFIG_SERIALIZATION => array('oldValue' => self::SERIALIZATION_JSON, 'newValue' => self::SERIALIZATION_JSON)) + parent::getConfiguration();
 }
 protected function getConfiguration()
 {
     return array(self::CONFIG_COLUMN_SCHEMA => array('slug' => 'text128'), self::CONFIG_KEY_SCHEMA => array('key_slug' => array('columns' => array('slug'), 'unique' => true), 'key_projectPHID' => array('columns' => array('projectPHID')))) + parent::getConfiguration();
 }
示例#10
0
 public function save()
 {
     $this->openTransaction();
     $result = parent::save();
     $this->updateDatasourceTokens();
     $this->saveTransaction();
     return $result;
 }