function ContentEntityBase::isNewRevision

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::isNewRevision()
  2. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::isNewRevision()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::isNewRevision()
3 calls to ContentEntityBase::isNewRevision()
BlockContent::preSaveRevision in core/modules/block_content/src/Entity/BlockContent.php
Acts on a revision before it gets saved.
Media::preSaveRevision in core/modules/media/src/Entity/Media.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 340

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.