public function addPage(__SiteMapPage &$page) { $uri = $page->getUri(); $this->_pages[$uri] =& $page; $route = $page->getRoute(); if (!key_exists($route, $this->_routes)) { $this->_routes[$route] = array(); } $this->_routes[$route][$uri] =& $page; $links = $page->getLinks(); foreach ($links as $link) { $href = $link->getHref(); $url_parts = parse_url($href); if ($url_parts['host'] != $_SERVER['HTTP_HOST']) { $this->_external_links[$href] =& $link; } if ($href != $uri) { if (!key_exists($href, $this->_connection_matrix)) { $this->_connection_matrix[$href] = array(); } $this->_connection_matrix[$href][$uri] =& $link; } } }