protected function ClearSubqueueItems::doExecute in Entityqueue 8
Clears the items of a subqueue.
Parameters
string $subqueue_id: The ID of the subqueue whose items will be cleared.
File
- src/
Plugin/ RulesAction/ ClearSubqueueItems.php, line 31
Class
- ClearSubqueueItems
- Provides a 'Clear subqueue items' action.
Namespace
Drupal\entityqueue\Plugin\RulesActionCode
protected function doExecute($subqueue_id) {
/** @var \Drupal\entityqueue\EntitySubqueueInterface $subqueue */
$subqueue = EntitySubqueue::load($subqueue_id);
$subqueue
->clearItems()
->save();
}