You are here

public function TemplateCollection::setContext in Courier 2.x

Same name and namespace in other branches
  1. 8 src/Entity/TemplateCollection.php \Drupal\courier\Entity\TemplateCollection::setContext()

Sets the context entity.

Parameters

\Drupal\courier\CourierContextInterface|null $entity: A courier_context entity, or NULL to remove context.

Return value

\Drupal\courier\TemplateCollectionInterface Return this object for chaining.

Overrides TemplateCollectionInterface::setContext

File

src/Entity/TemplateCollection.php, line 42

Class

TemplateCollection
Defines a local template collection entity.

Namespace

Drupal\courier\Entity

Code

public function setContext(CourierContextInterface $entity) {
  $this
    ->set('context', [
    'entity' => $entity,
  ]);
  return $this;
}