Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/build/HarbormasterBuild.php
<?php | <?php | ||||
final class HarbormasterBuild extends HarbormasterDAO | final class HarbormasterBuild extends HarbormasterDAO | ||||
implements | implements | ||||
PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorConduitResultInterface { | PhabricatorConduitResultInterface, | ||||
PhabricatorDestructibleInterface { | |||||
protected $buildablePHID; | protected $buildablePHID; | ||||
protected $buildPlanPHID; | protected $buildPlanPHID; | ||||
protected $buildStatus; | protected $buildStatus; | ||||
protected $buildGeneration; | protected $buildGeneration; | ||||
protected $buildParameters = array(); | protected $buildParameters = array(); | ||||
protected $initiatorPHID; | protected $initiatorPHID; | ||||
protected $planAutoKey; | protected $planAutoKey; | ||||
▲ Show 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | /* -( PhabricatorConduitResultInterface )---------------------------------- */ | ||||
public function getConduitSearchAttachments() { | public function getConduitSearchAttachments() { | ||||
return array( | return array( | ||||
id(new HarbormasterQueryBuildsSearchEngineAttachment()) | id(new HarbormasterQueryBuildsSearchEngineAttachment()) | ||||
->setAttachmentKey('querybuilds'), | ->setAttachmentKey('querybuilds'), | ||||
); | ); | ||||
} | } | ||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */ | |||||
public function destroyObjectPermanently( | |||||
PhabricatorDestructionEngine $engine) { | |||||
$viewer = $engine->getViewer(); | |||||
$this->openTransaction(); | |||||
$targets = id(new HarbormasterBuildTargetQuery()) | |||||
->setViewer($viewer) | |||||
->withBuildPHIDs(array($this->getPHID())) | |||||
->execute(); | |||||
foreach ($targets as $target) { | |||||
$engine->destroyObject($target); | |||||
} | |||||
$messages = id(new HarbormasterBuildMessageQuery()) | |||||
->setViewer($viewer) | |||||
->withReceiverPHIDs(array($this->getPHID())) | |||||
->execute(); | |||||
foreach ($messages as $message) { | |||||
$engine->destroyObject($message); | |||||
} | |||||
$this->delete(); | |||||
$this->saveTransaction(); | |||||
} | |||||
} | } |