mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 23:32:40 +01:00
4bba3fd4c1
Summary: Ref T9979. Convert all DestructionEngine behaviors to extensions. Test Plan: {F1033244} Destroyed an object, verifying: - Herald transcripts were destroyed; - edges were destroyed; - flags were destroyed; - tokens were destroyed; - transactions were destroyed; - worker tasks were cancelled. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9979 Differential Revision: https://secure.phabricator.com/D14832
26 lines
579 B
PHP
26 lines
579 B
PHP
<?php
|
|
|
|
final class HeraldTranscriptDestructionEngineExtension
|
|
extends PhabricatorDestructionEngineExtension {
|
|
|
|
const EXTENSIONKEY = 'herald.transcripts';
|
|
|
|
public function getExtensionName() {
|
|
return pht('Herald Transcripts');
|
|
}
|
|
|
|
public function destroyObject(
|
|
PhabricatorDestructionEngine $engine,
|
|
$object) {
|
|
|
|
$object_phid = $object->getPHID();
|
|
|
|
$transcripts = id(new HeraldTranscript())->loadAllWhere(
|
|
'objectPHID = %s',
|
|
$object_phid);
|
|
foreach ($transcripts as $transcript) {
|
|
$engine->destroyObject($transcript);
|
|
}
|
|
}
|
|
|
|
}
|