class StubRevisionableEntity

A stub revisionable entity for testing purposes.

Hierarchy

Expanded class hierarchy of StubRevisionableEntity

File

core/tests/Drupal/Tests/Core/Entity/StubRevisionableEntity.php, line 13

Namespace

Drupal\Tests\Core\Entity
View source
class StubRevisionableEntity extends StubEntityBase implements RevisionableInterface {
    
    /**
     * {@inheritdoc}
     */
    public function isNewRevision() : bool {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function setNewRevision($value = TRUE) : void {
    }
    
    /**
     * {@inheritdoc}
     */
    public function getRevisionId() : int|string|null {
        return NULL;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getLoadedRevisionId() : ?int {
        return NULL;
    }
    
    /**
     * {@inheritdoc}
     */
    public function updateLoadedRevisionId() : static {
        return $this;
    }
    
    /**
     * {@inheritdoc}
     */
    public function isDefaultRevision($new_value = NULL) : bool {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function wasDefaultRevision() : bool {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function isLatestRevision() : bool {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) : void {
    }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.