You are here

protected function MenuTreeStorage::loadFullMultiple in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadFullMultiple()

Loads all table fields for multiple menu link definitions by ID.

Parameters

array $ids: The IDs to load.

Return value

array The loaded menu link definitions.

2 calls to MenuTreeStorage::loadFullMultiple()
MenuTreeStorage::loadFull in core/lib/Drupal/Core/Menu/MenuTreeStorage.php
Loads all table fields, not just those that are in the plugin definition.
MenuTreeStorage::purgeMultiple in core/lib/Drupal/Core/Menu/MenuTreeStorage.php
Purges multiple menu links that no longer exist.

File

core/lib/Drupal/Core/Menu/MenuTreeStorage.php, line 758

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

protected function loadFullMultiple(array $ids) {
  $query = $this->connection
    ->select($this->table, NULL, $this->options);
  $query
    ->fields($this->table);
  $query
    ->condition('id', $ids, 'IN');
  $loaded = $this
    ->safeExecuteSelect($query)
    ->fetchAllAssoc('id', \PDO::FETCH_ASSOC);
  foreach ($loaded as &$link) {
    foreach ($this
      ->serializedFields() as $name) {
      if (isset($link[$name])) {
        $link[$name] = unserialize($link[$name]);
      }
    }
  }
  return $loaded;
}