/**
* Retrieve a route by instance identifier
*
* @param string $instanceId instance identifier
* @return InstanceRoute
*/
public function findByInstanceId($instanceId)
{
if (!array_key_exists($instanceId, $this->mapByInstanceId)) {
if (!($route = $this->repo->findByInstanceId($instanceId))) {
return null;
}
$this->setToMap($route);
}
return $this->mapByInstanceId[$instanceId];
}