public function EntityBCDecorator::set

Forwards the call to the decorated entity.

Overrides ComplexDataInterface::set

File

drupal/core/lib/Drupal/Core/Entity/EntityBCDecorator.php, line 242
Contains \Drupal\Core\Entity\EntityBCDecorator.

Class

EntityBCDecorator
Provides backwards compatible (BC) access to entity fields.

Namespace

Drupal\Core\Entity

Code

public function set($property_name, $value, $notify = TRUE) {

  // Ensure this works with not yet defined fields.
  if (!isset($this->definitions[$property_name])) {
    return $this
      ->__set($property_name, $value);
  }
  return $this->decorated
    ->set($property_name, $value);
}