public MenuTreeStorage::loadMultiple(array $ids)
Loads multiple plugin definitions from the storage.
Parameters
array $ids: An array of plugin IDs.
Return value
array An array of plugin definition arrays keyed by plugin ID, which are the actual definitions after the loadMultiple() including all those plugins from $ids.
Overrides MenuTreeStorageInterface::loadMultiple
File
- core/lib/Drupal/Core/Menu/MenuTreeStorage.php, line 692
Class
- MenuTreeStorage
- Provides a menu tree storage using the database.
Namespace
Drupal\Core\Menu
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public function loadMultiple( array $ids ) { $missing_ids = array_diff ( $ids , array_keys ( $this ->definitions)); if ( $missing_ids ) { $query = $this ->connection->select( $this ->table, $this ->options); $query ->fields( $this ->table, $this ->definitionFields()); $query ->condition( 'id' , $missing_ids , 'IN' ); $loaded = $this ->safeExecuteSelect( $query )->fetchAllAssoc( 'id' , \PDO::FETCH_ASSOC); foreach ( $loaded as $id => $link ) { $this ->definitions[ $id ] = $this ->prepareLink( $link ); } } return array_intersect_key ( $this ->definitions, array_flip ( $ids )); } |
Please login to continue.