public function __construct($link) { parent::__construct($link); if (is_numeric($link)) { $this->page = Page::find($link); } else { // Extract the query string and fragement $this->queryString = parse_url($link, PHP_URL_QUERY); $this->urlFragment = parse_url($link, PHP_URL_FRAGMENT); $path = URL::getInternalPath($link); $this->page = Page::findByUri($path); } }