You are here

public function EntityForm::setEntityManager in Drupal 8

Sets the entity manager for this form.

Parameters

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.

Return value

$this

Overrides EntityFormInterface::setEntityManager

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use EntityFormInterface::setEntityTypeManager() instead.

See also

https://www.drupal.org/node/2549139

File

core/lib/Drupal/Core/Entity/EntityForm.php, line 463

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function setEntityManager(EntityManagerInterface $entity_manager) {
  @trigger_error('EntityForm::setEntityManager() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use EntityFormInterface::setEntityTypeManager() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  $this->privateEntityManager = $entity_manager;
  return $this;
}