You are here

public function ContentEntityBase::toArray 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::toArray()

Gets an array of all property values.

Return value

mixed[] An array of property values, keyed by property name.

Overrides Entity::toArray

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function toArray() {
  $values = array();
  foreach ($this
    ->getFields() as $name => $property) {
    $values[$name] = $property
      ->getValue();
  }
  return $values;
}