You are here

public function XmlSitemapLinkStorage::load in XML sitemap 8

Same name and namespace in other branches
  1. 2.x src/XmlSitemapLinkStorage.php \Drupal\xmlsitemap\XmlSitemapLinkStorage::load()

Load a specific sitemap link from the database.

Parameters

string $entity_type: A string with the entity type id.

string $entity_id: Entity ID.

Return value

array A sitemap link (array) or FALSE if the conditions were not found.

Overrides XmlSitemapLinkStorageInterface::load

1 call to XmlSitemapLinkStorage::load()
XmlSitemapLinkStorage::create in src/XmlSitemapLinkStorage.php
Create a sitemap link from an entity.

File

src/XmlSitemapLinkStorage.php, line 321

Class

XmlSitemapLinkStorage
XmlSitemap link storage service class.

Namespace

Drupal\xmlsitemap

Code

public function load($entity_type, $entity_id) {
  $link = $this
    ->loadMultiple([
    'type' => $entity_type,
    'id' => $entity_id,
  ]);
  return $link ? reset($link) : FALSE;
}