function TaxonomyVocabulary::get_paths in Simple XML sitemap 8
Returns an array of all urls and their data of a bundle.
@abstract
Parameters
string $bundle: Machine name of the bundle, eg. 'page'.
Return value
array $paths A numeric array of Drupal internal path data sets containing the internal path, url objects for every language (optional), lastmod (optional) and priority (optional):
array( 0 => array( 'path_data' => array( 'path' => '/relative/path/to/drupal/page', 'urls' => array( //optional 'en' => Drupal\Core\Url, 'de' => Drupal\Core\Url, ), ), 'priority' => 0.5 // optional 'lastmod' => '1234567890' // optional: content changed unix date ), )
Overrides LinkGeneratorBase::get_paths
File
- src/
Plugin/ LinkGenerator/ TaxonomyVocabulary.php, line 26 - Contains \Drupal\simplesitemap\LinkGenerator\TaxonomyVocabulary.
Class
- TaxonomyVocabulary
- TaxonomyVocabulary class.
Namespace
Drupal\simplesitemap\Plugin\LinkGeneratorCode
function get_paths($bundle) {
$results = db_query("SELECT tid, changed FROM {taxonomy_term_field_data} WHERE vid = :vid", array(
':vid' => $bundle,
))
->fetchAllAssoc('tid');
$paths = array();
foreach ($results as $id => $data) {
$paths[$id]['path_data'] = $this
->get_multilang_urls_from_route("entity.taxonomy_term.canonical", array(
'taxonomy_term' => $id,
));
$paths[$id]['lastmod'] = $data->changed;
}
return $paths;
}