protected function NodeStorageController::mapToDataStorageRecord

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

Parameters

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

$langcode: The language code of the translation to get.

Return value

\stdClass The record to store.

Overrides DatabaseStorageControllerNG::mapToDataStorageRecord

File

drupal/core/modules/node/lib/Drupal/node/NodeStorageController.php, line 119
Definition of Drupal\node\NodeStorageController.

Class

NodeStorageController
Controller class for nodes.

Namespace

Drupal\node

Code

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;
}