public function ContentEntityBase::toArray in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::toArray()
- 10 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 EntityBase::toArray
File
- core/
lib/ Drupal/ Core/ Entity/ ContentEntityBase.php, line 690
Class
- ContentEntityBase
- Implements Entity Field API specific enhancements to the Entity class.
Namespace
Drupal\Core\EntityCode
public function toArray() {
$values = [];
foreach ($this
->getFields() as $name => $property) {
$values[$name] = $property
->getValue();
}
return $values;
}