function 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
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\EntityCode
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.