Maps from an entity object to the storage record of the base table.
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;
}