You are here

interface RevisionableInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/RevisionableInterface.php \Drupal\Core\Entity\RevisionableInterface

Provides methods for an entity to support revisions.

Hierarchy

Expanded class hierarchy of RevisionableInterface

All classes that implement RevisionableInterface

1 file declares its use of RevisionableInterface
BulkForm.php in core/modules/system/src/Plugin/views/field/BulkForm.php
Contains \Drupal\system\Plugin\views\field\BulkForm.

File

core/lib/Drupal/Core/Entity/RevisionableInterface.php, line 13
Contains \Drupal\Core\Entity\RevisionableInterface.

Namespace

Drupal\Core\Entity
View source
interface RevisionableInterface {

  /**
   * Determines whether a new revision should be created on save.
   *
   * @return bool
   *   TRUE if a new revision should be created.
   *
   * @see \Drupal\Core\Entity\EntityInterface::setNewRevision()
   */
  public function isNewRevision();

  /**
   * Enforces an entity to be saved as a new revision.
   *
   * @param bool $value
   *   (optional) Whether a new revision should be saved.
   *
   * @throws \LogicException
   *   Thrown if the entity does not support revisions.
   *
   * @see \Drupal\Core\Entity\EntityInterface::isNewRevision()
   */
  public function setNewRevision($value = TRUE);

  /**
   * Gets the revision identifier of the entity.
   *
   * @return
   *   The revision identifier of the entity, or NULL if the entity does not
   *   have a revision identifier.
   */
  public function getRevisionId();

  /**
   * Checks if this entity is the default revision.
   *
   * @param bool $new_value
   *   (optional) A Boolean to (re)set the isDefaultRevision flag.
   *
   * @return bool
   *   TRUE if the entity is the default revision, FALSE otherwise. If
   *   $new_value was passed, the previous value is returned.
   */
  public function isDefaultRevision($new_value = NULL);

  /**
   * Acts on a revision before it gets saved.
   *
   * @param EntityStorageInterface $storage
   *   The entity storage object.
   * @param \stdClass $record
   *   The revision object.
   */
  public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record);

}

Members

Namesort descending Modifiers Type Description Overrides
RevisionableInterface::getRevisionId public function Gets the revision identifier of the entity. 1
RevisionableInterface::isDefaultRevision public function Checks if this entity is the default revision. 1
RevisionableInterface::isNewRevision public function Determines whether a new revision should be created on save. 1
RevisionableInterface::preSaveRevision public function Acts on a revision before it gets saved. 1
RevisionableInterface::setNewRevision public function Enforces an entity to be saved as a new revision. 1