public function MultipleValuesGenerator::setEntity in Computed Field 3.x
Associates the service with a particular entity.
It's necessary to call this method before any other non-static methods.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity whose field is being calculated.
Return value
$this The object itself, for method chaining.
File
- src/
MultipleValuesGenerator.php, line 73
Class
- MultipleValuesGenerator
- Service for generating missing values for multi-valued computed fields.
Namespace
Drupal\computed_fieldCode
public function setEntity(EntityInterface $entity) {
$this->entity = $entity;
return $this;
}