Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
| Show First 20 Lines • Show All 1,195 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
| ->loadAllWhere('repositoryPHID = %s', $this->getPHID()); | ->loadAllWhere('repositoryPHID = %s', $this->getPHID()); | ||||
| foreach ($ref_cursors as $cursor) { | foreach ($ref_cursors as $cursor) { | ||||
| $cursor->delete(); | $cursor->delete(); | ||||
| } | } | ||||
| $conn_w = $this->establishConnection('w'); | $conn_w = $this->establishConnection('w'); | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
epriestley: This should be `$engine->destroyObject($book)` and be fired from `destroyObjectPermanently()`… | |||||
| 'DELETE FROM %T WHERE repositoryID = %d', | 'DELETE FROM %T WHERE repositoryID = %d', | ||||
| self::TABLE_FILESYSTEM, | self::TABLE_FILESYSTEM, | ||||
| $this->getID()); | $this->getID()); | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'DELETE FROM %T WHERE repositoryID = %d', | 'DELETE FROM %T WHERE repositoryID = %d', | ||||
| self::TABLE_PATHCHANGE, | self::TABLE_PATHCHANGE, | ||||
| ▲ Show 20 Lines • Show All 695 Lines • ▼ Show 20 Lines | |||||
| /* -( PhabricatorDestructibleInterface )----------------------------------- */ | /* -( PhabricatorDestructibleInterface )----------------------------------- */ | ||||
| public function destroyObjectPermanently( | public function destroyObjectPermanently( | ||||
| PhabricatorDestructionEngine $engine) { | PhabricatorDestructionEngine $engine) { | ||||
| $this->openTransaction(); | $this->openTransaction(); | ||||
| $this->delete(); | $this->delete(); | ||||
| $books = id(new DivinerBookQuery()) | |||||
| ->setViewer($engine->getViewer()) | |||||
| ->withRepositoryPHIDs(array($this->getPHID())) | |||||
| ->execute(); | |||||
| foreach ($books as $book) { | |||||
| $engine->destroyObject($book); | |||||
| } | |||||
| $atoms = id(new DivinerAtomQuery()) | |||||
| ->setViewer($engine->getViewer()) | |||||
| ->withRepositoryPHIDs(array($this->getPHID())) | |||||
| ->execute(); | |||||
| foreach ($atoms as $atom) { | |||||
| $engine->destroyObject($atom); | |||||
| } | |||||
| $this->saveTransaction(); | $this->saveTransaction(); | ||||
| } | } | ||||
| } | } | ||||
This should be $engine->destroyObject($book) and be fired from destroyObjectPermanently(), not delete().