protected function DatabaseStorageControllerNG::mapToStorageRecord

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

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity object.

Return value

\stdClass The record to store.

1 call to DatabaseStorageControllerNG::mapToStorageRecord()
DatabaseStorageControllerNG::save in drupal/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php
Overrides DatabaseStorageController::save().

File

drupal/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php, line 529
Contains \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 (drupal_schema_fields_sql($this->entityInfo['base_table']) as $name) {
    $record->{$name} = $entity->{$name}->value;
  }
  return $record;
}