You are here

public function EntitySubqueue::addItem in Entityqueue 8

Adds an entity to a subqueue.

Parameters

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

Return value

$this

Overrides EntitySubqueueInterface::addItem

File

src/Entity/EntitySubqueue.php, line 279

Class

EntitySubqueue
Defines the EntitySubqueue entity class.

Namespace

Drupal\entityqueue\Entity

Code

public function addItem(EntityInterface $entity) {
  $this
    ->get('items')
    ->appendItem($entity
    ->id());
  return $this;
}