You are here

public function XmlSitemapLinkStorage::loadMultiple in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 src/XmlSitemapLinkStorage.php \Drupal\xmlsitemap\XmlSitemapLinkStorage::loadMultiple()

Load sitemap links from the database.

Parameters

array $conditions: An array of conditions on the {xmlsitemap} table in the form 'field' => $value.

Return value

array An array of sitemap link arrays.

Overrides XmlSitemapLinkStorageInterface::loadMultiple

1 call to XmlSitemapLinkStorage::loadMultiple()
XmlSitemapLinkStorage::load in src/XmlSitemapLinkStorage.php
Load a specific sitemap link from the database.

File

src/XmlSitemapLinkStorage.php, line 329

Class

XmlSitemapLinkStorage
XmlSitemap link storage service class.

Namespace

Drupal\xmlsitemap

Code

public function loadMultiple(array $conditions = []) {
  $query = $this->connection
    ->select('xmlsitemap');
  $query
    ->fields('xmlsitemap');
  foreach ($conditions as $field => $value) {
    $operator = is_array($value) ? 'IN' : '=';
    $query
      ->condition($field, $value, $operator);
  }
  $links = $query
    ->execute()
    ->fetchAll(\PDO::FETCH_ASSOC);
  return $links;
}