public function MenuLinkStorageController::loadUpdatedCustomized

Loads updated and customized menu links for specific router paths.

Note that this is a low-level method and it doesn't return fully populated menu link entities. (e.g. no fields are attached)

Parameters

array $router_paths: An array of router paths.

Return value

array An array of menu link objects indexed by their ids.

File

drupal/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php, line 382
Contains \Drupal\menu_link\MenuLinkStorageController.

Class

MenuLinkStorageController
Controller class for menu links.

Namespace

Drupal\menu_link

Code

public function loadUpdatedCustomized(array $router_paths) {
  $query = parent::buildQuery(NULL);
  $query
    ->condition(db_or()
    ->condition('updated', 1)
    ->condition(db_and()
    ->condition('router_path', $router_paths, 'NOT IN')
    ->condition('external', 0)
    ->condition('customized', 1)));
  $query_result = $query
    ->execute();
  if (!empty($this->entityInfo['class'])) {

    // We provide the necessary arguments for PDO to create objects of the
    // specified entity class.
    // @see Drupal\Core\Entity\EntityInterface::__construct()
    $query_result
      ->setFetchMode(\PDO::FETCH_CLASS, $this->entityInfo['class'], array(
      array(),
      $this->entityType,
    ));
  }
  return $query_result
    ->fetchAllAssoc($this->idKey);
}