diskNumber = $partition->getDiskNumber(); $this->partitionNumber = $partition->getPartitionNumber(); $this->partitionCode = $partition->getPartitionCode(); $this->size = $partition->getSize(); $this->cacheContent = $partition->getCacheContent(); $this->filesystem = $partition->getFilesystem(); if ($partition->getOperativeSystem()) { $this->operativeSystem = new OperativeSystemOutput($partition->getOperativeSystem()); } $this->memoryUsage = $partition->getMemoryUsage(); if ($partition->getImage()) { $this->image = new ImageOutput($partition->getImage()); } } public function createOrUpdateEntity(?Partition $partition = null): Partition { if (!$partition) { $partition = new Partition(); } $partition->setDiskNumber($this->diskNumber); $partition->setPartitionNumber($this->partitionNumber); $partition->setPartitionCode($this->partitionCode); $partition->setSize($this->size * 1024); $partition->setCacheContent($this->cacheContent); $partition->setFilesystem($this->filesystem); if ($this->operativeSystem) { $partition->setOperativeSystem($this->operativeSystem->getEntity()); } $partition->setMemoryUsage($this->memoryUsage * 100); if ($this->image) { $partition->setImage($this->image->getEntity()); } return $partition; } }