/** * Adds a site to the collection, keyed by hostname * @return SiteCollection */ public function addSite(Site $site) { if (!isset($this->sites[$site->getHostName()])) { $this->sites[$site->getHostName()] = $site; } return $this; }