You are here

public function ContentEntityBase::getFieldDefinitions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::getFieldDefinitions()

Gets an array of field definitions of all contained fields.

Return value

\Drupal\Core\Field\FieldDefinitionInterface[] An array of field definitions, keyed by field name.

Overrides FieldableEntityInterface::getFieldDefinitions

See also

\Drupal\Core\Entity\EntityManagerInterface::getFieldDefinitions()

9 calls to ContentEntityBase::getFieldDefinitions()
ContentEntityBase::getFieldDefinition in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets the definition of a contained field.
ContentEntityBase::getFields in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets an array of all field item lists.
ContentEntityBase::getTranslatableFields in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets an array of field item lists for translatable fields.
ContentEntityBase::hasTranslationChanges in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Determines if the current translation of the entity has unsaved changes.
ContentEntityBase::removeTranslation in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Removes the translation identified by the given language code.

... See full list

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 567
Contains \Drupal\Core\Entity\ContentEntityBase.

Class

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

Namespace

Drupal\Core\Entity

Code

public function getFieldDefinitions() {
  if (!isset($this->fieldDefinitions)) {
    $this->fieldDefinitions = $this
      ->entityManager()
      ->getFieldDefinitions($this->entityTypeId, $this
      ->bundle());
  }
  return $this->fieldDefinitions;
}