/**
  * Diese Methode lädt die Seiten dieses Menüs, basierend
  * auf einer Root-Seite und dem angemeldeten Benutzer. Die
  * geladenen Seiten werden im $pages Property abgelegt.
  *
  * @return Page[]
  * @throws Exception
  */
 public function loadChildrenForCurrentUser()
 {
     if (!$this->hasChildren()) {
         return [];
     }
     // Versuch es aus dem Cache zu lesen
     $this->pages = Cache::get($this->getCacheId(), null);
     if ($this->pages === null) {
         $this->pages = [];
         $sql = "\n            select seiten.*, text.*\n            from\n\n                (select distinct pa_id, pa_site, pa_parent, pa_bezeichnung, pa_link, pa_pos, pa_title, pa_module,\n                    pa_action, pa_css, pa_innertemplate, pa_parameter, pa_haschildren, pa_icon from pages\n                    join rechte on re_element = CONCAT('pages.', pa_id) and re_recht = 1 and re_rolle in {$_SESSION['rollen']}\n                    where pa_site = :site and pa_parent = :parent and (pa_ausblenden != 1) ) seiten\n\n                    left outer join texte text on text.te_element = CONCAT('pages.', pa_id) and text.te_sprache = :sprache\n\n             order by pa_pos\n\n\t\t    ";
         $sql = "\nselect distinct \n\tpa_id, pa_site, pa_parent, pa_bezeichnung, pa_link, pa_pos, pa_title, pa_module, pa_action, pa_css, pa_innertemplate, pa_parameter, \n\tpa_haschildren, pa_icon, text.* \n\nfrom pages \n\tjoin rechte on re_element = CONCAT('pages.', pa_id) and re_recht = 1 and re_rolle in {$_SESSION['rollen']}\n    join texte text on text.te_element = CONCAT('pages.', pa_id) and text.te_sprache = :sprache \n\nwhere pa_site = :site and pa_parent = :parent and  (pa_ausblenden != 1) order by pa_pos            \n            ";
         $this->db->query($sql, ['site' => $this->pa_site, 'parent' => $this->id, 'sprache' => $_SESSION['sp_id']]);
         $results = $this->db->fetchAll();
         foreach ($results as $row) {
             $item = new Page();
             $item->loadFromRow($row);
             $item->loadTextFromRow($row);
             $this->pages[] = $item;
         }
         Cache::set($this->getCacheId(), $this->pages);
     }
     return $this->pages;
 }