public function ContentEntityBase::isNewRevision

public 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()

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 287

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityBase.php/function/ContentEntityBase::isNewRevision/8.1.x