description = $hardwareProfile->getDescription(); $this->comments = $hardwareProfile->getComments(); } public function createOrUpdateEntity(?HardwareProfile $hardwareProfile = null): HardwareProfile { if (!$hardwareProfile) { $hardwareProfile = new HardwareProfile(); } $hardwareProfile->setDescription($this->description); $hardwareProfile->setComments($this->comments); return $hardwareProfile; } }