You are here

protected function ShuffleSubqueueItems::doExecute in Entityqueue 8

Shuffles the items of a subqueue.

Parameters

string $subqueue_id: The ID of the subqueue whose items will be shuffled.

File

src/Plugin/RulesAction/ShuffleSubqueueItems.php, line 31

Class

ShuffleSubqueueItems
Provides a 'Shuffle subqueue items' action.

Namespace

Drupal\entityqueue\Plugin\RulesAction

Code

protected function doExecute($subqueue_id) {

  /** @var \Drupal\entityqueue\EntitySubqueueInterface $subqueue */
  $subqueue = EntitySubqueue::load($subqueue_id);
  $subqueue
    ->shuffleItems()
    ->save();
}