/** * @param Project $project * @return Site */ public function setProject(Project $project = null) { if ($this->project) { $this->project->removeSite($this); } $this->project = $project; if ($project) { $project->addSite($this); } return $this; }