public function EntityNG::setCompatibilityMode

Enables or disable the compatibility mode.

Parameters

bool $enabled: Whether to enable the mode.

See also

EntityNG::compatibilityMode

File

drupal/core/lib/Drupal/Core/Entity/EntityNG.php, line 286
Definition of Drupal\Core\Entity\EntityNG.

Class

EntityNG
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function setCompatibilityMode($enabled) {
  $this->compatibilityMode = (bool) $enabled;
  if ($enabled) {
    $this
      ->updateOriginalValues();
    $this->fields = array();
  }
}