src/Entity/PageStatus.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PageStatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassPageStatusRepository::class)]
  9. class PageStatus
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(length2)]
  14.     private ?string $pageStatusCode null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $updated null;
  19.     #[ORM\Column]
  20.     private ?int $updatedBy null;
  21.     #[ORM\OneToMany(mappedBy'pageStatusCode'targetEntityPage::class)]
  22.     #@ORM\JoinColumn(name="page_status_code", referencedColumnName="page_status_code")
  23.     private Collection $pages;
  24.     public function __construct()
  25.     {
  26.         $this->pages = new ArrayCollection();
  27.     }
  28.     public function getPageStatusCode(): ?string
  29.     {
  30.         return $this->pageStatusCode;
  31.     }
  32.     public function setPageStatusCode(string $pageStatusCode): self
  33.     {
  34.         $this->pageStatusCode $pageStatusCode;
  35.         return $this;
  36.     }
  37.     public function getName(): ?string
  38.     {
  39.         return $this->name;
  40.     }
  41.     public function setName(string $name): self
  42.     {
  43.         $this->name $name;
  44.         return $this;
  45.     }
  46.     public function getUpdated(): ?\DateTimeInterface
  47.     {
  48.         return $this->updated;
  49.     }
  50.     public function setUpdated(\DateTimeInterface $updated): self
  51.     {
  52.         $this->updated $updated;
  53.         return $this;
  54.     }
  55.     public function getUpdatedBy(): ?int
  56.     {
  57.         return $this->updatedBy;
  58.     }
  59.     public function setUpdatedBy(int $updatedBy): self
  60.     {
  61.         $this->updatedBy $updatedBy;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return Collection<int, Page>
  66.      */
  67.     public function getPages(): Collection
  68.     {
  69.         return $this->pages;
  70.     }
  71.     public function addPage(Page $page): self
  72.     {
  73.         if (!$this->pages->contains($page)) {
  74.             $this->pages->add($page);
  75.             $page->setPageStatusCode($this);
  76.         }
  77.         return $this;
  78.     }
  79.     public function removePage(Page $page): self
  80.     {
  81.         if ($this->pages->removeElement($page)) {
  82.             // set the owning side to null (unless already changed)
  83.             if ($page->getPageStatusCode() === $this) {
  84.                 $page->setPageStatusCode(null);
  85.             }
  86.         }
  87.         return $this;
  88.     }
  89. }