You are here

public function SequenceIndex::add in Multiversion 8

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

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity:

Overrides SequenceIndexInterface::add

File

src/Entity/Index/SequenceIndex.php, line 59

Class

SequenceIndex

Namespace

Drupal\multiversion\Entity\Index

Code

public function add(ContentEntityInterface $entity) {
  $workspace_id = null;
  $record = $this
    ->buildRecord($entity);
  if ($entity
    ->getEntityType()
    ->get('workspace') === FALSE) {
    $workspace_id = 0;
  }
  $this
    ->sortedSetStore($workspace_id)
    ->add($record['seq'], $record);
}