function __construct(Sessions $sessions, Route $route) { $branchLevelId = $route->branchLevelId(); if ($branchLevelId) { $this->session = $sessions[$branchLevelId]; } else { $this->session = $sessions[0]; } }