You are here

public function EntitySubqueue::removeItem in Entityqueue 8

Removes an entity from a subqueue.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An entity object.

Return value

$this

Overrides EntitySubqueueInterface::removeItem

File

src/Entity/EntitySubqueue.php, line 287

Class

EntitySubqueue
Defines the EntitySubqueue entity class.

Namespace

Drupal\entityqueue\Entity

Code

public function removeItem(EntityInterface $entity) {
  $index = $this
    ->getItemPosition($entity);
  if ($index !== FALSE) {
    $this
      ->get('items')
      ->offsetUnset($index);
  }
  return $this;
}