mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +01:00
Implement PhabricatorDestructibleInterface for event triggers
Summary: Ref T6881. When stuff with triggers is destroyed, it should destroy the triggers. Test Plan: Will test in Instances. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T6881 Differential Revision: https://secure.phabricator.com/D11435
This commit is contained in:
parent
7cbbd7868f
commit
cccdc48883
2 changed files with 25 additions and 2 deletions
|
@ -5884,7 +5884,10 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorWorkerTaskData' => 'PhabricatorWorkerDAO',
|
'PhabricatorWorkerTaskData' => 'PhabricatorWorkerDAO',
|
||||||
'PhabricatorWorkerTaskDetailController' => 'PhabricatorDaemonController',
|
'PhabricatorWorkerTaskDetailController' => 'PhabricatorDaemonController',
|
||||||
'PhabricatorWorkerTestCase' => 'PhabricatorTestCase',
|
'PhabricatorWorkerTestCase' => 'PhabricatorTestCase',
|
||||||
'PhabricatorWorkerTrigger' => 'PhabricatorWorkerDAO',
|
'PhabricatorWorkerTrigger' => array(
|
||||||
|
'PhabricatorWorkerDAO',
|
||||||
|
'PhabricatorDestructibleInterface',
|
||||||
|
),
|
||||||
'PhabricatorWorkerTriggerEvent' => 'PhabricatorWorkerDAO',
|
'PhabricatorWorkerTriggerEvent' => 'PhabricatorWorkerDAO',
|
||||||
'PhabricatorWorkerTriggerPHIDType' => 'PhabricatorPHIDType',
|
'PhabricatorWorkerTriggerPHIDType' => 'PhabricatorPHIDType',
|
||||||
'PhabricatorWorkerTriggerQuery' => 'PhabricatorOffsetPagedQuery',
|
'PhabricatorWorkerTriggerQuery' => 'PhabricatorOffsetPagedQuery',
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class PhabricatorWorkerTrigger
|
final class PhabricatorWorkerTrigger
|
||||||
extends PhabricatorWorkerDAO {
|
extends PhabricatorWorkerDAO
|
||||||
|
implements
|
||||||
|
PhabricatorDestructibleInterface {
|
||||||
|
|
||||||
protected $triggerVersion;
|
protected $triggerVersion;
|
||||||
protected $clockClass;
|
protected $clockClass;
|
||||||
|
@ -127,4 +129,22 @@ final class PhabricatorWorkerTrigger
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -( PhabricatorDestructibleInterface )----------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
public function destroyObjectPermanently(
|
||||||
|
PhabricatorDestructionEngine $engine) {
|
||||||
|
|
||||||
|
$this->openTransaction();
|
||||||
|
queryfx(
|
||||||
|
$this->establishConnection('w'),
|
||||||
|
'DELETE FROM %T WHERE triggerID = %d',
|
||||||
|
id(new PhabricatorWorkerTriggerEvent())->getTableName(),
|
||||||
|
$this->getID());
|
||||||
|
|
||||||
|
$this->delete();
|
||||||
|
$this->saveTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue