You are here

protected function WorkspaceManager::getSortedNegotiators in Multiversion 8

Return value

\Drupal\multiversion\Workspace\WorkspaceNegotiatorInterface[]

2 calls to WorkspaceManager::getSortedNegotiators()
WorkspaceManager::getActiveWorkspaceId in src/Workspace/WorkspaceManager.php
Fetches the currently active workspace ID.
WorkspaceManager::setActiveWorkspace in src/Workspace/WorkspaceManager.php
Sets the active workspace for the site/session.

File

src/Workspace/WorkspaceManager.php, line 160

Class

WorkspaceManager

Namespace

Drupal\multiversion\Workspace

Code

protected function getSortedNegotiators() {
  if (!isset($this->sortedNegotiators)) {

    // Sort the negotiators according to priority.
    krsort($this->negotiators);

    // Merge nested negotiators from $this->negotiators into
    // $this->sortedNegotiators.
    $this->sortedNegotiators = [];
    foreach ($this->negotiators as $builders) {
      $this->sortedNegotiators = array_merge($this->sortedNegotiators, $builders);
    }
  }
  return $this->sortedNegotiators;
}