You are here

public function ContentEntityBase::isNewRevision in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::isNewRevision()

Determines whether a new revision should be created on save.

Return value

bool TRUE if a new revision should be created.

Overrides RevisionableInterface::isNewRevision

See also

\Drupal\Core\Entity\EntityInterface::setNewRevision()

2 calls to ContentEntityBase::isNewRevision()
BlockContent::preSaveRevision in core/modules/block_content/src/Entity/BlockContent.php
Acts on a revision before it gets saved.
Node::preSaveRevision in core/modules/node/src/Entity/Node.php
Acts on a revision before it gets saved.

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 290
Contains \Drupal\Core\Entity\ContentEntityBase.

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function isNewRevision() {
  return $this->newRevision || $this
    ->getEntityType()
    ->hasKey('revision') && !$this
    ->getRevisionId();
}