Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialRevision.php
| Show First 20 Lines • Show All 1,027 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
| // an id or phid column for delete() to act on | // an id or phid column for delete() to act on | ||||
| $dummy_path = new DifferentialAffectedPath(); | $dummy_path = new DifferentialAffectedPath(); | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'DELETE FROM %T WHERE revisionID = %d', | 'DELETE FROM %T WHERE revisionID = %d', | ||||
| $dummy_path->getTableName(), | $dummy_path->getTableName(), | ||||
| $this->getID()); | $this->getID()); | ||||
| $viewstates = id(new DifferentialViewStateQuery()) | $viewstate_query = id(new DifferentialViewStateQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withObjectPHIDs(array($this->getPHID())); | ->withObjectPHIDs(array($this->getPHID())); | ||||
| $viewstates = new PhabricatorQueryIterator($viewstate_query); | |||||
| foreach ($viewstates as $viewstate) { | foreach ($viewstates as $viewstate) { | ||||
| $viewstate->delete(); | $viewstate->delete(); | ||||
| } | } | ||||
| $this->delete(); | $this->delete(); | ||||
| $this->saveTransaction(); | $this->saveTransaction(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines | |||||