function ContentEntityBase::wasDefaultRevision
File
-
core/
lib/ Drupal/ Core/ Entity/ ContentEntityBase.php, line 360
Class
- ContentEntityBase
- Implements Entity Field API specific enhancements to the Entity class.
Namespace
Drupal\Core\EntityCode
public function wasDefaultRevision() {
/** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
$entity_type = $this->getEntityType();
if (!$entity_type->isRevisionable()) {
return TRUE;
}
$revision_default_key = $entity_type->getRevisionMetadataKey('revision_default');
$value = $this->isNew() || $this->get($revision_default_key)->value;
return $value;
}