/**
  * {@inheritdoc}
  */
 public function delete()
 {
     // Delete all migrations contained in this group.
     $query = \Drupal::entityQuery('migration')->condition('migration_group', $this->id());
     $names = $query->execute();
     // Order the migrations according to their dependencies.
     /** @var MigrationInterface[] $migrations */
     $migrations = \Drupal::entityTypeManager()->getStorage('migration')->loadMultiple($names);
     // Delete in reverse order, so dependencies are never violated.
     $migrations = array_reverse($migrations);
     foreach ($migrations as $migration) {
         $migration->delete();
     }
     // Finally, delete the group itself.
     parent::delete();
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     foreach (array_keys($this->getLinks([], TRUE)) as $link_key) {
         $this->getMenuLinkManager()->removeDefinition($link_key, FALSE);
     }
     parent::delete();
 }
Example #3
0
 /**
  * Given a wid, delete the workflow and its data.
  */
 public function delete()
 {
     $wid = $this->id();
     if (!$this->isDeletable()) {
         // @todo: throw error if not workflow->isDeletable().
     } else {
         // Delete associated state (also deletes any associated transitions).
         foreach ($this->getStates($all = TRUE) as $state) {
             $state->deactivate('');
             $state->delete();
         }
         // Delete the workflow.
         parent::delete();
     }
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     parent::delete();
     $this->reschedule($this->id());
 }
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     if ($this->isLocked()) {
         throw new \LogicException('Locked statuses cannot be deleted.');
     }
     parent::delete();
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     foreach ($this->fields as $field) {
         $field = FieldConfig::loadByName($this->getEventEntityTypeId(), $this->getEventBundle(), $field);
         if ($field) {
             $field->delete();
         }
         $display = entity_get_form_display($this->entity_type, $this->bundle, 'rng_event');
         if (!$display->isNew()) {
             $display->delete();
         }
     }
     parent::delete();
 }