protected function DatabaseStorageControllerNG::mapToStorageRecord

Maps from an entity object to the storage record of the base table.

File

drupal/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php, line 298
Definition of Drupal\Core\Entity\DatabaseStorageControllerNG.

Class

DatabaseStorageControllerNG
Implements Field API specific enhancements to the DatabaseStorageController class.

Namespace

Drupal\Core\Entity

Code

protected function mapToStorageRecord(EntityInterface $entity) {
  $record = new \stdClass();
  foreach ($this->entityInfo['schema_fields_sql']['base_table'] as $name) {
    $record->{$name} = $entity->{$name}->value;
  }
  return $record;
}