/** * Получаем id города * * @param City $city * * @return self */ public function setCityId($city) { if ($city) { $this->cityId = $city->getId(); } return $this; }