You are here

public function FieldableEdgeEntityBase::getFieldDefinition in Apigee Edge 8

Gets the definition of a contained field.

Parameters

string $name: The name of the field.

Return value

\Drupal\Core\Field\FieldDefinitionInterface|null The definition of the field or null if the field does not exist.

Overrides FieldableEntityInterface::getFieldDefinition

4 calls to FieldableEdgeEntityBase::getFieldDefinition()
AttributesAwareFieldableEdgeEntityBase::get in src/Entity/AttributesAwareFieldableEdgeEntityBase.php
Gets a field item list.
AttributesAwareFieldableEdgeEntityBase::setPropertyValue in src/Entity/AttributesAwareFieldableEdgeEntityBase.php
Updates the property value on an entity by field name.
FieldableEdgeEntityBase::convertFieldValueToPropertyValue in src/Entity/FieldableEdgeEntityBase.php
Converts a field value to a property value.
FieldableEdgeEntityBase::hasField in src/Entity/FieldableEdgeEntityBase.php
Determines whether the entity has a field with the given name.

File

src/Entity/FieldableEdgeEntityBase.php, line 307

Class

FieldableEdgeEntityBase
Base field support for Apigee Entities without making them content entities.

Namespace

Drupal\apigee_edge\Entity

Code

public function getFieldDefinition($name) {
  if (!isset($this->fieldDefinitions)) {
    $this
      ->getFieldDefinitions();
  }
  if (isset($this->fieldDefinitions[$name])) {
    return $this->fieldDefinitions[$name];
  }
}