Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
add func
Browse files Browse the repository at this point in the history
  • Loading branch information
klaukl authored Feb 18, 2024
1 parent 662f527 commit 710e217
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/TideSiteHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,31 @@ public function getAllSites() {
return $sites;
}


/**
* Returns all sites.
*
* @return \Drupal\taxonomy\TermInterface[]
* List of sites.
*/
public function getAllSitesAndSiteSections() {
$sites = [];

try {
$terms = $this->entityTypeManager->getStorage('taxonomy_term')
->loadByProperties(['vid' => 'sites']);
/** @var \Drupal\taxonomy\TermInterface $site */
foreach ($terms as $site) {
$sites[$site->id()] = $site;
}
}
catch (\Exception $exception) {
watchdog_exception('tide_site', $exception);
}

return $sites;
}

/**
* Loads a Site term by ID.
*
Expand Down

0 comments on commit 710e217

Please sign in to comment.