You are here

public function EntityDecorator::decorate in Automatic Entity Label 8.2

Same name and namespace in other branches
  1. 8.3 src/EntityDecorator.php \Drupal\auto_entitylabel\EntityDecorator::decorate()
  2. 8 src/EntityDecorator.php \Drupal\auto_entitylabel\EntityDecorator::decorate()

Automatic entity label entity decorator.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: Entity.

Return value

\Drupal\auto_entitylabel\AutoEntityLabelManager|\Drupal\Core\Entity\ContentEntityInterface Return Content Entity Interface.

Overrides EntityDecoratorInterface::decorate

File

src/EntityDecorator.php, line 69

Class

EntityDecorator
Provides an content entity decorator for automatic label generation.

Namespace

Drupal\auto_entitylabel

Code

public function decorate(ContentEntityInterface $entity) {
  $this->entity = new AutoEntityLabelManager($entity, $this->configFactory, $this->entityTypeManager, $this->token);
  return $this->entity;
}