You are here

public function RevisionTreeIndex::updateTree in Multiversion 8

Same name and namespace in other branches
  1. 8.2 src/Entity/Index/RevisionTreeIndex.php \Drupal\multiversion\Entity\Index\RevisionTreeIndex::updateTree()

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity:

array $branch:

Return value

RevisionTreeIndexInterface

Overrides RevisionTreeIndexInterface::updateTree

File

src/Entity/Index/RevisionTreeIndex.php, line 153

Class

RevisionTreeIndex
The revision tree index.

Namespace

Drupal\multiversion\Entity\Index

Code

public function updateTree(ContentEntityInterface $entity, array $branch = []) {
  if ($entity
    ->getEntityType()
    ->get('workspace') === FALSE) {
    $this
      ->keyValueStore($entity
      ->uuid(), 0)
      ->setMultiple($branch);
  }
  else {
    $this
      ->keyValueStore($entity
      ->uuid())
      ->setMultiple($branch);
  }
  return $this;
}