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());
}
doc_Drupal
2016-10-29 08:56:58
Comments
Leave a Comment

Please login to continue.