// Populate the "revision_default" flag. Skip this when we are resaving
// the revision, and the flag is set to FALSE, since it is not possible to
// set a previously default revision to non-default. However, setting a
// previously non-default revision to default is allowed for advanced
// use-cases.
if ($this->entityType->
isRevisionable() && ($entity->
isNewRevision() ||
$entity->
isDefaultRevision())) { $revision_default_key =
$this->entityType->
getRevisionMetadataKey('revision_default'
);
$entity->
set($revision_default_key,
$entity->
isDefaultRevision());
} $this->
doSaveFieldItems($entity);
return $return;
} /**
* Writes entity field values to the storage.
*
* This method is responsible for allocating entity and revision identifiers
* and updating the entity object with their values.
*
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
* The entity object.
* @param string[] $names
* (optional) The name of the fields to be written to the storage. If an
* empty value is passed all field values are saved.
*/