class WorkspacesLayoutTempstoreRepository
Same name and namespace in other branches
- main core/modules/workspaces/src/WorkspacesLayoutTempstoreRepository.php \Drupal\workspaces\WorkspacesLayoutTempstoreRepository
Provides a mechanism for loading workspace-specific layout changes.
Hierarchy
- class \Drupal\layout_builder\LayoutTempstoreRepository implements \Drupal\layout_builder\LayoutTempstoreRepositoryInterface
- class \Drupal\workspaces\WorkspacesLayoutTempstoreRepository extends \Drupal\layout_builder\LayoutTempstoreRepository
Expanded class hierarchy of WorkspacesLayoutTempstoreRepository
File
-
core/
modules/ workspaces/ src/ WorkspacesLayoutTempstoreRepository.php, line 13
Namespace
Drupal\workspacesView source
class WorkspacesLayoutTempstoreRepository extends LayoutTempstoreRepository {
/**
* The workspace manager.
*/
protected WorkspaceManagerInterface $workspaceManager;
/**
* Sets the workspace manager.
*
* @param \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager
* The workspace manager service.
*/
public function setWorkspacesManager(WorkspaceManagerInterface $workspace_manager) : static {
$this->workspaceManager = $workspace_manager;
return $this;
}
/**
* {@inheritdoc}
*/
protected function getKey(SectionStorageInterface $section_storage) : string {
$key = parent::getKey($section_storage);
// Suffix the layout tempstore key with a workspace ID when one is active.
if ($this->workspaceManager
->hasActiveWorkspace()) {
$key .= '.workspace:' . $this->workspaceManager
->getActiveWorkspace()
->id();
}
return $key;
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
|---|---|---|---|---|
| LayoutTempstoreRepository::$cache | protected | property | The static cache of loaded values. | |
| LayoutTempstoreRepository::$tempStoreFactory | protected | property | The shared tempstore factory. | |
| LayoutTempstoreRepository::delete | public | function | Removes the tempstore version of a section storage. | Overrides LayoutTempstoreRepositoryInterface::delete |
| LayoutTempstoreRepository::get | public | function | Gets the tempstore version of a section storage, if it exists. | Overrides LayoutTempstoreRepositoryInterface::get |
| LayoutTempstoreRepository::getTempstore | protected | function | Gets the shared tempstore. | |
| LayoutTempstoreRepository::has | public | function | Checks for the existence of a tempstore version of a section storage. | Overrides LayoutTempstoreRepositoryInterface::has |
| LayoutTempstoreRepository::set | public | function | Stores this section storage in tempstore. | Overrides LayoutTempstoreRepositoryInterface::set |
| LayoutTempstoreRepository::__construct | public | function | LayoutTempstoreRepository constructor. | |
| WorkspacesLayoutTempstoreRepository::$workspaceManager | protected | property | The workspace manager. | |
| WorkspacesLayoutTempstoreRepository::getKey | protected | function | Gets the string to use as the tempstore key. | Overrides LayoutTempstoreRepository::getKey |
| WorkspacesLayoutTempstoreRepository::setWorkspacesManager | public | function | Sets the workspace manager. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.