<?phpnamespace App\Entity;use App\Repository\WorkroomRevisionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: WorkroomRevisionRepository::class)]class WorkroomRevision{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\ManyToOne(targetEntity: Workroom::class, inversedBy: 'workroomRevisions')] #[ORM\JoinColumn(nullable: false)] private $workroom; #[ORM\Column(type: 'string', length: 255)] private $name; #[ORM\Column(type: 'smallint')] private $version; #[ORM\Column(type: 'datetime_immutable')] private $createdAt; #[ORM\Column(type: 'datetime_immutable')] private $updatedAt; #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'workroomRevisions')] #[ORM\JoinColumn(nullable: false)] private $user; #[ORM\OneToMany(targetEntity: WorkroomSectionRevision::class, mappedBy: 'workroomRevision', orphanRemoval: true)] private $workroomSectionRevisions; public function __construct() { $this->workroomSectionRevisions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getWorkroom(): ?Workroom { return $this->workroom; } public function setWorkroom(?Workroom $workroom): self { $this->workroom = $workroom; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getVersion(): ?int { return $this->version; } public function setVersion(int $version): self { $this->version = $version; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } /** * @return Collection|WorkroomSectionRevision[] */ public function getWorkroomSectionRevisions(): Collection { return $this->workroomSectionRevisions; } public function addWorkroomSectionRevision(WorkroomSectionRevision $workroomSectionRevision): self { if (!$this->workroomSectionRevisions->contains($workroomSectionRevision)) { $this->workroomSectionRevisions[] = $workroomSectionRevision; $workroomSectionRevision->setWorkroomRevision($this); } return $this; } public function removeWorkroomSectionRevision(WorkroomSectionRevision $workroomSectionRevision): self { if ($this->workroomSectionRevisions->removeElement($workroomSectionRevision)) { // set the owning side to null (unless already changed) if ($workroomSectionRevision->getWorkroomRevision() === $this) { $workroomSectionRevision->setWorkroomRevision(null); } } return $this; }}