You are here

public function DashboardSectionStorage::getSectionListFromId in Dashboards with Layout Builder 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/SectionStorage/DashboardSectionStorage.php \Drupal\dashboards\Plugin\SectionStorage\DashboardSectionStorage::getSectionListFromId()

Derives the section list from the storage ID.

@internal This should only be called during section storage instantiation.

Parameters

string $id: The storage ID, see ::getStorageId().

Return value

\Drupal\layout_builder\SectionListInterface The section list.

Throws

\InvalidArgumentException Thrown if the ID is invalid.

Overrides SectionStorageInterface::getSectionListFromId

Deprecated

in drupal:8.7.0 and is removed from drupal:9.0.0. The section list should be derived from context. See https://www.drupal.org/node/3016262.

File

src/Plugin/SectionStorage/DashboardSectionStorage.php, line 120

Class

DashboardSectionStorage
Dashboard section storage.

Namespace

Drupal\dashboards\Plugin\SectionStorage

Code

public function getSectionListFromId($id) {
  @trigger_error('\\Drupal\\layout_builder\\SectionStorageInterface::getSectionListFromId() is deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. The section list should be derived from context. See https://www.drupal.org/node/3016262', E_USER_DEPRECATED);
  return $this->entityTypeManager
    ->getStorage('dashboard')
    ->load($id);
}