function FieldableEntityNormalizerTrait::getEntityFieldManager

Same name in other branches
  1. 9 core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php \Drupal\serialization\Normalizer\FieldableEntityNormalizerTrait::getEntityFieldManager()
  2. 10 core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php \Drupal\serialization\Normalizer\FieldableEntityNormalizerTrait::getEntityFieldManager()
  3. 11.x core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php \Drupal\serialization\Normalizer\FieldableEntityNormalizerTrait::getEntityFieldManager()

Returns the entity field manager.

Return value

\Drupal\Core\Entity\EntityFieldManagerInterface The entity field manager.

File

core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php, line 176

Class

FieldableEntityNormalizerTrait
A trait for providing fieldable entity normalization/denormalization methods.

Namespace

Drupal\serialization\Normalizer

Code

protected function getEntityFieldManager() {
    if (!$this->entityFieldManager) {
        @trigger_error('The entityFieldManager property must be set on the FieldEntityNormalizerTrait, it is required before Drupal 9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
        $this->entityFieldManager = \Drupal::service('entity_field.manager');
    }
    return $this->entityFieldManager;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.