/**
* Retrieve a route by url segment and site key
*
* @param string $url first segment of url
* @param string $siteKey site key
* @return InstanceRoute
*/
public function findByUrlAndSiteKey($url, $siteKey)
{
if (!isset($this->mapBySiteKey[$siteKey]) || !array_key_exists($url, $this->mapBySiteKey[$siteKey])) {
if (!($route = $this->repo->findByUrlAndSiteKey($url, $siteKey))) {
return null;
}
$this->setToMap($route);
}
return $this->mapBySiteKey[$siteKey][$url];
}