You are here

public function ContentEntityBase::isDefaultRevision 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::isDefaultRevision()

Checks if this entity is the default revision.

Parameters

bool $new_value: (optional) A Boolean to (re)set the isDefaultRevision flag.

Return value

bool TRUE if the entity is the default revision, FALSE otherwise. If $new_value was passed, the previous value is returned.

Overrides RevisionableInterface::isDefaultRevision

1 call to ContentEntityBase::isDefaultRevision()
Node::postSave in core/modules/node/src/Entity/Node.php
Acts on a saved entity before the insert or update hook is invoked.

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function isDefaultRevision($new_value = NULL) {
  $return = $this->isDefaultRevision;
  if (isset($new_value)) {
    $this->isDefaultRevision = (bool) $new_value;
  }
  return $return;
}