name = $command->getName(); $this->script = $command->getScript(); $this->enabled = $command->isEnabled(); $this->readOnly = $command->isReadOnly(); $this->parameters = $command->isParameters(); $this->comments = $command->getComments(); } public function createOrUpdateEntity(?Command $command = null): Command { if (!$command) { $command = new Command(); } $command->setName($this->name); $command->setScript($this->script); $command->setEnabled($this->enabled); $command->setReadOnly($this->readOnly); $command->setParameters($this->parameters); $command->setComments($this->comments); return $command; } }