Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialChangeset.php
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
} | } | ||||
$this->saveTransaction(); | $this->saveTransaction(); | ||||
return $ret; | return $ret; | ||||
} | } | ||||
public function delete() { | public function delete() { | ||||
$this->openTransaction(); | $this->openTransaction(); | ||||
$legacy_hunks = id(new DifferentialLegacyHunk())->loadAllWhere( | $hunks = id(new DifferentialHunk())->loadAllWhere( | ||||
'changesetID = %d', | 'changesetID = %d', | ||||
$this->getID()); | $this->getID()); | ||||
foreach ($legacy_hunks as $legacy_hunk) { | foreach ($hunks as $hunk) { | ||||
$legacy_hunk->delete(); | $hunk->delete(); | ||||
} | |||||
$modern_hunks = id(new DifferentialModernHunk())->loadAllWhere( | |||||
'changesetID = %d', | |||||
$this->getID()); | |||||
foreach ($modern_hunks as $modern_hunk) { | |||||
$modern_hunk->delete(); | |||||
} | } | ||||
$this->unsavedHunks = array(); | $this->unsavedHunks = array(); | ||||
queryfx( | queryfx( | ||||
$this->establishConnection('w'), | $this->establishConnection('w'), | ||||
'DELETE FROM %T WHERE id = %d', | 'DELETE FROM %T WHERE id = %d', | ||||
self::TABLE_CACHE, | self::TABLE_CACHE, | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |