function TemplateCollection::setContext in Courier 8
Same name and namespace in other branches
- 2.x 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 43
Class
- TemplateCollection
- Defines a local template collection entity.
Namespace
Drupal\courier\EntityCode
function setContext(CourierContextInterface $entity) {
$this
->set('context', [
'entity' => $entity,
]);
return $this;
}