You are here

public function EntityForm::__set in Drupal 8

File

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

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function __set($name, $value) {

  // We've changed the entityManager property from protected to private so
  // access is funnelled through __get above. This method is provided for BC
  // purposes, in case any extended class attempts to set the previously
  // accessible property directly.
  if ($name === 'entityManager') {
    @trigger_error('EntityForm::entityManager is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use EntityForm::entityTypeManager instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
    $this->privateEntityManager = $value;
  }
  else {

    // Ensure usual PHP behaviour of dynamically declaring properties works as
    // expected.
    $this->{$name} = $value;
  }
}