public function setEmail(CmsEmail $email = null) { if ($this->email !== $email) { $this->email = $email; if ($email) { $email->setUser($this); } } }