Maps from an entity object to the storage record of the data table.
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
$langcode: The language code of the translation to get.
\stdClass The record to store.
Overrides DatabaseStorageControllerNG::mapToDataStorageRecord
protected function mapToDataStorageRecord(EntityInterface $entity, $langcode) {
// @todo Remove this once comment is a regular entity field.
$record = parent::mapToDataStorageRecord($entity, $langcode);
$record->comment = isset($record->comment) ? intval($record->comment) : 0;
return $record;
}