You are here

public function TemplateCollection::setOwner in Courier 2.x

Same name and namespace in other branches
  1. 8 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 57

Class

TemplateCollection
Defines a local template collection entity.

Namespace

Drupal\courier\Entity

Code

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