public function ContentEntityBase::isDefaultRevision

public ContentEntityBase::isDefaultRevision($new_value = NULL)

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

File

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

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

© 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::isDefaultRevision/8.1.x