You are here

function TemplateCollection::setOwner in Courier 8

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

Sets the owner entity.

Parameters

\Drupal\Core\Entity\EntityInterface|NULL $entity: An entity, or NULL to set as global.

Return value

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

Overrides TemplateCollectionInterface::setOwner

File

src/Entity/TemplateCollection.php, line 58

Class

TemplateCollection
Defines a local template collection entity.

Namespace

Drupal\courier\Entity

Code

function setOwner(EntityInterface $entity) {
  $this
    ->set('owner', [
    'entity' => $entity,
  ]);
  return $this;
}