You are here

protected function RemoveItemFromSubqueue::doExecute in Entityqueue 8

Removes the given entity from a subqueue.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to be removed from the subqueue.

string $subqueue_id: The ID of the subqueue where the entity will be remove.

File

src/Plugin/RulesAction/RemoveItemFromSubqueue.php, line 38

Class

RemoveItemFromSubqueue
Provides a 'Remove item from subqueue' action.

Namespace

Drupal\entityqueue\Plugin\RulesAction

Code

protected function doExecute(EntityInterface $entity, $subqueue_id) {

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