Created
May 11, 2022 02:04
-
-
Save heitoralthmann/9049a85a6bb0c4a867f30a5aabe67bbd to your computer and use it in GitHub Desktop.
Drupal entityqueue - How to get / load items programmatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* | |
* Assuming that you've created a queue using the simple queue handler, | |
* that means a subqueue has been created automatically with the same name | |
* as the queue. | |
* Therefore, to get the (sub)queue items programatically, you can do this: | |
*/ | |
$queue = \Drupal::entityTypeManager()->getStorage('entity_subqueue')->load('queue_id'); | |
$items = $queue->items->referencedEntities(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment