Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / xaction / PhabricatorCalendarImportDeleteTransaction.php
blob83bf78169f399bb94e44453db7f7039ef5bf4577
1 <?php
3 final class PhabricatorCalendarImportDeleteTransaction
4 extends PhabricatorCalendarImportTransactionType {
6 const TRANSACTIONTYPE = 'calendar.import.delete';
8 public function generateOldValue($object) {
9 return false;
12 public function applyExternalEffects($object, $value) {
13 $events = id(new PhabricatorCalendarEventQuery())
14 ->setViewer($this->getActor())
15 ->withImportSourcePHIDs(array($object->getPHID()))
16 ->execute();
18 $engine = new PhabricatorDestructionEngine();
19 foreach ($events as $event) {
20 $engine->destroyObject($event);
24 public function getTitle() {
25 return pht(
26 '%s deleted imported events from this source.',
27 $this->renderAuthor());