You are here

public static function FeedType::postDelete in Feeds 8.3

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides ConfigEntityBundleBase::postDelete

File

src/Entity/FeedType.php, line 596

Class

FeedType
Defines the Feeds feed type entity.

Namespace

Drupal\feeds\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
  foreach ($entities as $entity) {
    foreach ($entity
      ->getPlugins() as $plugin) {
      $plugin
        ->onFeedTypeDelete();
    }

    // Delete any existing queues related to this type.
    if ($queue = \Drupal::queue('feeds_feed_refresh:' . $entity
      ->id())) {
      $queue
        ->deleteQueue();
    }
  }

  // Clear the queue worker plugin cache to remove this derivative.
  \Drupal::service('plugin.manager.queue_worker')
    ->clearCachedDefinitions();
}