1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +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:
epriestley 2015-01-19 16:55:38 -08:00
parent 7cbbd7868f
commit cccdc48883
2 changed files with 25 additions and 2 deletions

View file

@ -5884,7 +5884,10 @@ phutil_register_library_map(array(
'PhabricatorWorkerTaskData' => 'PhabricatorWorkerDAO',
'PhabricatorWorkerTaskDetailController' => 'PhabricatorDaemonController',
'PhabricatorWorkerTestCase' => 'PhabricatorTestCase',
'PhabricatorWorkerTrigger' => 'PhabricatorWorkerDAO',
'PhabricatorWorkerTrigger' => array(
'PhabricatorWorkerDAO',
'PhabricatorDestructibleInterface',
),
'PhabricatorWorkerTriggerEvent' => 'PhabricatorWorkerDAO',
'PhabricatorWorkerTriggerPHIDType' => 'PhabricatorPHIDType',
'PhabricatorWorkerTriggerQuery' => 'PhabricatorOffsetPagedQuery',

View file

@ -1,7 +1,9 @@
<?php
final class PhabricatorWorkerTrigger
extends PhabricatorWorkerDAO {
extends PhabricatorWorkerDAO
implements
PhabricatorDestructibleInterface {
protected $triggerVersion;
protected $clockClass;
@ -127,4 +129,22 @@ final class PhabricatorWorkerTrigger
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();
}
}