entityTypeManager = $entity_type_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('entity_type.manager') ); } /** * {@inheritdoc} */ public function supportsMultipleSubqueues() { return TRUE; } /** * {@inheritdoc} */ public function hasAutomatedSubqueues() { return FALSE; } /** * {@inheritdoc} */ public function onQueuePostDelete(EntityQueueInterface $queue, EntityStorageInterface $storage) { // Delete all the subqueues when the parent queue is deleted. $subqueue_storage = $this->entityTypeManager->getStorage('entity_subqueue'); $subqueues = $subqueue_storage->loadByProperties([$this->entityTypeManager->getDefinition('entity_subqueue')->getKey('bundle') => $queue->id()]); $subqueue_storage->delete($subqueues); } }