You are here

public function FieldableEdgeEntityBase::getFields in Apigee Edge 8

Gets an array of all field item lists.

Parameters

bool $include_computed: If set to TRUE, computed fields are included. Defaults to TRUE.

Return value

\Drupal\Core\Field\FieldItemListInterface[] An array of field item lists implementing, keyed by field name.

Overrides FieldableEntityInterface::getFields

2 calls to FieldableEdgeEntityBase::getFields()
FieldableEdgeEntityBase::getIterator in src/Entity/FieldableEdgeEntityBase.php
FieldableEdgeEntityBase::toArray in src/Entity/FieldableEdgeEntityBase.php
Gets an array of all property values.

File

src/Entity/FieldableEdgeEntityBase.php, line 329

Class

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

Namespace

Drupal\apigee_edge\Entity

Code

public function getFields($include_computed = TRUE) {
  $fields = [];
  foreach ($this
    ->getFieldDefinitions() as $name => $definition) {
    if ($include_computed || !$definition
      ->isComputed()) {
      $fields[$name] = $this
        ->get($name);
    }
  }
  return $fields;
}