getParent(); $menu->closeThis(); // check for parent if exists, get parent if ($parent->getParent()) { $menu = $parent->getParent(); } else { $menu = $parent; } $menu = NginxVhostFactory::addVhosts($menu, NginxVhost::find(), self::VHOST_INDEX); $menu->open(); } }