public function delete() { // $this->openTransaction(); foreach ($this->loadChangesets() as $changeset) { $changeset->delete(); } $ret = parent::delete(); // $this->saveTransaction(); return $ret; }
public function save() { $this->openTransaction(); $ret = parent::save(); foreach ($this->unsavedChangesets as $changeset) { $changeset->setDiffID($this->getID()); $changeset->save(); } $this->saveTransaction(); return $ret; }
public function delete() { $this->openTransaction(); $legacy_hunks = id(new DifferentialLegacyHunk())->loadAllWhere('changesetID = %d', $this->getID()); foreach ($legacy_hunks as $legacy_hunk) { $legacy_hunk->delete(); } $modern_hunks = id(new DifferentialModernHunk())->loadAllWhere('changesetID = %d', $this->getID()); foreach ($modern_hunks as $modern_hunk) { $modern_hunk->delete(); } $this->unsavedHunks = array(); queryfx($this->establishConnection('w'), 'DELETE FROM %T WHERE id = %d', self::TABLE_CACHE, $this->getID()); $ret = parent::delete(); $this->saveTransaction(); return $ret; }
public function getConfiguration() { return array(self::CONFIG_SERIALIZATION => array('metadata' => self::SERIALIZATION_JSON)) + parent::getConfiguration(); }
public function getConfiguration() { return array(self::CONFIG_TIMESTAMPS => false) + parent::getConfiguration(); }
public function delete() { // $this->openTransaction(); foreach ($this->loadHunks() as $hunk) { $hunk->delete(); } $this->_hunks = array(); $ret = parent::delete(); // $this->saveTransaction(); return $ret; }
public function save() { if (!$this->getMailKey()) { $this->mailKey = Filesystem::readRandomCharacters(40); } return parent::save(); }
protected function getConfiguration() { return array(self::CONFIG_COLUMN_SCHEMA => array('draftKey' => 'text64'), self::CONFIG_KEY_SCHEMA => array('key_unique' => array('columns' => array('objectPHID', 'authorPHID', 'draftKey'), 'unique' => true))) + parent::getConfiguration(); }
public function save() { if (!$this->getMailKey()) { $this->mailKey = sha1(Filesystem::readRandomBytes(20)); } return parent::save(); }
protected function getConfiguration() { return array(self::CONFIG_SERIALIZATION => array('data' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('name' => 'text128'), self::CONFIG_KEY_SCHEMA => array('diffID' => array('columns' => array('diffID', 'name'), 'unique' => true))) + parent::getConfiguration(); }
public function delete() { $this->openTransaction(); $diffs = $this->loadDiffs(); foreach ($diffs as $diff) { $diff->delete(); } $conn_w = $this->establishConnection('w'); queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', self::RELATIONSHIP_TABLE, $this->getID()); queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', self::TABLE_COMMIT, $this->getID()); $comments = id(new DifferentialComment())->loadAllWhere('revisionID = %d', $this->getID()); foreach ($comments as $comment) { $comment->delete(); } $inlines = id(new DifferentialInlineComment())->loadAllWhere('revisionID = %d', $this->getID()); foreach ($inlines as $inline) { $inline->delete(); } $fields = id(new DifferentialAuxiliaryField())->loadAllWhere('revisionPHID = %s', $this->getPHID()); foreach ($fields as $field) { $field->delete(); } // we have to do paths a little differentally as they do not have // an id or phid column for delete() to act on $dummy_path = new DifferentialAffectedPath(); queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', $dummy_path->getTableName(), $this->getID()); $result = parent::delete(); $this->saveTransaction(); return $result; }
protected function getConfiguration() { return array(self::CONFIG_TIMESTAMPS => false, self::CONFIG_COLUMN_SCHEMA => array('id' => null), self::CONFIG_KEY_SCHEMA => array('PRIMARY' => null, 'repositoryID' => array('columns' => array('repositoryID', 'pathID', 'epoch')), 'revisionID' => array('columns' => array('revisionID')))) + parent::getConfiguration(); }
public function delete() { $this->openTransaction(); foreach ($this->loadChangesets() as $changeset) { $changeset->delete(); } $properties = id(new DifferentialDiffProperty())->loadAllWhere('diffID = %d', $this->getID()); foreach ($properties as $prop) { $prop->delete(); } $ret = parent::delete(); $this->saveTransaction(); return $ret; }
public function delete() { $this->openTransaction(); foreach ($this->loadHunks() as $hunk) { $hunk->delete(); } $this->_hunks = array(); queryfx($this->establishConnection('w'), 'DELETE FROM %T WHERE id = %d', self::TABLE_CACHE, $this->getID()); $ret = parent::delete(); $this->saveTransaction(); return $ret; }
public function delete() { $this->openTransaction(); $diffs = $this->loadDiffs(); foreach ($diffs as $diff) { $diff->delete(); } $conn_w = $this->establishConnection('w'); queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', self::RELATIONSHIP_TABLE, $this->getID()); queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', self::TABLE_COMMIT, $this->getID()); $comments = id(new DifferentialComment())->loadAllWhere('revisionID = %d', $this->getID()); foreach ($comments as $comment) { $comment->delete(); } $inlines = id(new DifferentialInlineComment())->loadAllWhere('revisionID = %d', $this->getID()); foreach ($inlines as $inline) { $inline->delete(); } $fields = id(new DifferentialAuxiliaryField())->loadAllWhere('revisionPHID = %s', $this->getPHID()); foreach ($fields as $field) { $field->delete(); } $paths = id(new DifferentialAffectedPath())->loadAllWhere('revisionID = %d', $this->getID()); foreach ($paths as $path) { $path->delete(); } $result = parent::delete(); $this->saveTransaction(); return $result; }
protected function getConfiguration() { return array(self::CONFIG_TIMESTAMPS => false, self::CONFIG_KEY_SCHEMA => array('key_user' => array('columns' => array('userPHID', 'commentID'), 'unique' => true), 'key_comment' => array('columns' => array('commentID')))) + parent::getConfiguration(); }