function EntityAdapter::getProperties

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getProperties()
  2. 8.9.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getProperties()
  3. 10 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getProperties()

Overrides ComplexDataInterface::getProperties

1 call to EntityAdapter::getProperties()
EntityAdapter::applyDefaultValue in core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
Applies the default value.
1 method overrides EntityAdapter::getProperties()
ConfigEntityAdapter::getProperties in core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php
Gets an array of property objects.

File

core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php, line 107

Class

EntityAdapter
Defines the "entity" data type.

Namespace

Drupal\Core\Entity\Plugin\DataType

Code

public function getProperties($include_computed = FALSE) {
    if (!isset($this->entity)) {
        throw new MissingDataException('Unable to get properties as no entity has been provided.');
    }
    if (!$this->entity instanceof FieldableEntityInterface) {
        return [];
    }
    return $this->entity
        ->getFields($include_computed);
}

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