You are here

public function SmartQueue::deleteSubqueues in Entityqueue 8

Deletes a list of subqueues.

File

modules/entityqueue_smartqueue/src/Plugin/EntityQueueHandler/SmartQueue.php, line 302

Class

SmartQueue
Plugin annotation @EntityQueueHandler( id = "smartqueue", title = @Translation("Smart queue"), description = @Translation("Provides automated subqueues for each entity of a given type."), )

Namespace

Drupal\entityqueue_smartqueue\Plugin\EntityQueueHandler

Code

public function deleteSubqueues($subqueue_ids, &$context) {
  $storage = $this->entityTypeManager
    ->getStorage('entity_subqueue');
  $subqueues = $storage
    ->loadMultiple($subqueue_ids);
  $storage
    ->delete($subqueues);
  foreach ($subqueues as $subqueue) {
    $context['message'] = $this
      ->t('Deleted subqueue @id', [
      '@id' => $subqueue
        ->id(),
    ]);
  }
}