In contao 3 PageModel, there is not method to find a first published root. Only nearest is. \PageModel::findFirstPublishedRootByHostAndLanguag e(string $strHost, mixed $varLanguage, array $arrOptions);
which needs few parameters
So I've to do like:
Is there a better way?Code:$objFirstPublishedRoot = $this->Database->prepare("SELECT id, language FROM tl_page WHERE pid=0 AND published=1 ORDER BY sorting")->execute()->limit(1);
Bookmarks