Maps from an entity object to the storage record of the base table.
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
\stdClass The record to store.
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;
}