Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/storage/PhabricatorProjectTrigger.php
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | return urisprintf( | ||||
| '/project/trigger/%d/', | '/project/trigger/%d/', | ||||
| $this->getID()); | $this->getID()); | ||||
| } | } | ||||
| public function getObjectName() { | public function getObjectName() { | ||||
| return pht('Trigger %d', $this->getID()); | return pht('Trigger %d', $this->getID()); | ||||
| } | } | ||||
| public function getRulesDescription() { | |||||
| // TODO: Summarize the trigger rules in human-readable text. | |||||
| return pht('Does things.'); | |||||
| } | |||||
| /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
| public function getApplicationTransactionEditor() { | public function getApplicationTransactionEditor() { | ||||
| return new PhabricatorProjectTriggerEditor(); | return new PhabricatorProjectTriggerEditor(); | ||||
| } | } | ||||
| Show All 24 Lines | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* -( PhabricatorDestructibleInterface )----------------------------------- */ | /* -( PhabricatorDestructibleInterface )----------------------------------- */ | ||||
| public function destroyObjectPermanently( | public function destroyObjectPermanently( | ||||
| PhabricatorDestructionEngine $engine) { | PhabricatorDestructionEngine $engine) { | ||||
| $this->openTransaction(); | |||||
| $conn = $this->establishConnection('w'); | |||||
| // Remove the reference to this trigger from any columns which use it. | |||||
| queryfx( | |||||
| $conn, | |||||
| 'UPDATE %R SET triggerPHID = null WHERE triggerPHID = %s', | |||||
| new PhabricatorProjectColumn(), | |||||
| $this->getPHID()); | |||||
| $this->delete(); | $this->delete(); | ||||
| $this->saveTransaction(); | |||||
| } | } | ||||
amckinley: This code isn't actually invoked by `PhabricatorProjectColumnRemoveTriggerController`, right? | |||||
Done Inline ActionsRight, this is just so that when you bin/remove destroy <phid> a trigger we end up with minimally-weird column state since I don't really want to write all the UI for "this column references a trigger which no longer exists" and doubt the outcome would ever be any different from removing it, practically. epriestley: Right, this is just so that when you `bin/remove destroy <phid>` a trigger we end up with… | |||||
| } | } | ||||
This code isn't actually invoked by PhabricatorProjectColumnRemoveTriggerController, right? Also, pretty sure my above comment is now irrelevant.