Maps from an entity object to the storage record of the revision table.
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
\stdClass The record to store.
protected function mapToRevisionStorageRecord(ComplexDataInterface $entity) {
$record = new \stdClass();
$definitions = $entity
->getPropertyDefinitions();
foreach (drupal_schema_fields_sql($this->entityInfo['revision_table']) as $name) {
if (isset($definitions[$name]) && isset($entity->{$name}->value)) {
$record->{$name} = $entity->{$name}->value;
}
}
return $record;
}