Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / flag / engineextension / PhabricatorFlagDestructionEngineExtension.php
blob20bc19d4aa50bd3570ff8b9050ccca97bacf5749
1 <?php
3 final class PhabricatorFlagDestructionEngineExtension
4 extends PhabricatorDestructionEngineExtension {
6 const EXTENSIONKEY = 'flags';
8 public function getExtensionName() {
9 return pht('Flags');
12 public function destroyObject(
13 PhabricatorDestructionEngine $engine,
14 $object) {
16 $object_phid = $object->getPHID();
18 if ($object instanceof PhabricatorFlaggableInterface) {
19 $flags = id(new PhabricatorFlag())->loadAllWhere(
20 'objectPHID = %s',
21 $object_phid);
22 foreach ($flags as $flag) {
23 $flag->delete();
27 $flags = id(new PhabricatorFlag())->loadAllWhere(
28 'ownerPHID = %s',
29 $object_phid);
30 foreach ($flags as $flag) {
31 $flag->delete();