src/Entity/WorkroomRevision.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WorkroomRevisionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassWorkroomRevisionRepository::class)]
  8. class WorkroomRevision
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityWorkroom::class, inversedBy'workroomRevisions')]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private $workroom;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $name;
  19.     #[ORM\Column(type'smallint')]
  20.     private $version;
  21.     #[ORM\Column(type'datetime_immutable')]
  22.     private $createdAt;
  23.     #[ORM\Column(type'datetime_immutable')]
  24.     private $updatedAt;
  25.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'workroomRevisions')]
  26.     #[ORM\JoinColumn(nullablefalse)]
  27.     private $user;
  28.     #[ORM\OneToMany(targetEntityWorkroomSectionRevision::class, mappedBy'workroomRevision'orphanRemovaltrue)]
  29.     private $workroomSectionRevisions;
  30.     public function __construct()
  31.     {
  32.         $this->workroomSectionRevisions = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getWorkroom(): ?Workroom
  39.     {
  40.         return $this->workroom;
  41.     }
  42.     public function setWorkroom(?Workroom $workroom): self
  43.     {
  44.         $this->workroom $workroom;
  45.         return $this;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): self
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function getVersion(): ?int
  57.     {
  58.         return $this->version;
  59.     }
  60.     public function setVersion(int $version): self
  61.     {
  62.         $this->version $version;
  63.         return $this;
  64.     }
  65.     public function getCreatedAt(): ?\DateTimeImmutable
  66.     {
  67.         return $this->createdAt;
  68.     }
  69.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  70.     {
  71.         $this->createdAt $createdAt;
  72.         return $this;
  73.     }
  74.     public function getUpdatedAt(): ?\DateTimeImmutable
  75.     {
  76.         return $this->updatedAt;
  77.     }
  78.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  79.     {
  80.         $this->updatedAt $updatedAt;
  81.         return $this;
  82.     }
  83.     public function getUser(): ?User
  84.     {
  85.         return $this->user;
  86.     }
  87.     public function setUser(?User $user): self
  88.     {
  89.         $this->user $user;
  90.         return $this;
  91.     }
  92.     /**
  93.      * @return Collection|WorkroomSectionRevision[]
  94.      */
  95.     public function getWorkroomSectionRevisions(): Collection
  96.     {
  97.         return $this->workroomSectionRevisions;
  98.     }
  99.     public function addWorkroomSectionRevision(WorkroomSectionRevision $workroomSectionRevision): self
  100.     {
  101.         if (!$this->workroomSectionRevisions->contains($workroomSectionRevision)) {
  102.             $this->workroomSectionRevisions[] = $workroomSectionRevision;
  103.             $workroomSectionRevision->setWorkroomRevision($this);
  104.         }
  105.         return $this;
  106.     }
  107.     public function removeWorkroomSectionRevision(WorkroomSectionRevision $workroomSectionRevision): self
  108.     {
  109.         if ($this->workroomSectionRevisions->removeElement($workroomSectionRevision)) {
  110.             // set the owning side to null (unless already changed)
  111.             if ($workroomSectionRevision->getWorkroomRevision() === $this) {
  112.                 $workroomSectionRevision->setWorkroomRevision(null);
  113.             }
  114.         }
  115.         return $this;
  116.     }
  117. }