src/Entity/Lists.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ListsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassListsRepository::class)]
  8. class Lists
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityClinics::class, inversedBy'lists')]
  15.     private $clinic;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $listType;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $name;
  20.     #[ORM\Column(type'integer')]
  21.     private $itemCount;
  22.     #[ORM\Column(type'datetime')]
  23.     private $modified;
  24.     #[ORM\Column(type'datetime')]
  25.     private $created;
  26.     #[ORM\OneToMany(targetEntityListItems::class, mappedBy'list')]
  27.     private $listItems;
  28.     #[ORM\Column(type'boolean'nullabletrue)]
  29.     private $isProtected;
  30.     public function __construct()
  31.     {
  32.         $this->setCreated(new \DateTime());
  33.         if ($this->getModified() == null) {
  34.             $this->setModified(new \DateTime());
  35.         }
  36.         $this->listItems = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getClinic(): ?Clinics
  43.     {
  44.         return $this->clinic;
  45.     }
  46.     public function setClinic(?Clinics $clinic): self
  47.     {
  48.         $this->clinic $clinic;
  49.         return $this;
  50.     }
  51.     public function getListType(): ?string
  52.     {
  53.         return $this->listType;
  54.     }
  55.     public function setListType(string $listType): self
  56.     {
  57.         $this->listType $listType;
  58.         return $this;
  59.     }
  60.     public function getName(): ?string
  61.     {
  62.         return $this->name;
  63.     }
  64.     public function setName(string $name): self
  65.     {
  66.         $this->name $name;
  67.         return $this;
  68.     }
  69.     public function getItemCount(): ?int
  70.     {
  71.         return $this->itemCount;
  72.     }
  73.     public function setItemCount(int $itemCount): self
  74.     {
  75.         $this->itemCount $itemCount;
  76.         return $this;
  77.     }
  78.     public function getModified(): ?\DateTimeInterface
  79.     {
  80.         return $this->modified;
  81.     }
  82.     public function setModified(\DateTimeInterface $modified): self
  83.     {
  84.         $this->modified $modified;
  85.         return $this;
  86.     }
  87.     public function getCreated(): ?\DateTimeInterface
  88.     {
  89.         return $this->created;
  90.     }
  91.     public function setCreated(\DateTimeInterface $created): self
  92.     {
  93.         $this->created $created;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, ListItems>
  98.      */
  99.     public function getListItems(): Collection
  100.     {
  101.         return $this->listItems;
  102.     }
  103.     public function addListItem(ListItems $listItem): self
  104.     {
  105.         if (!$this->listItems->contains($listItem)) {
  106.             $this->listItems[] = $listItem;
  107.             $listItem->setList($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeListItem(ListItems $listItem): self
  112.     {
  113.         if ($this->listItems->removeElement($listItem)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($listItem->getList() === $this) {
  116.                 $listItem->setList(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     public function getIsProtected(): ?bool
  122.     {
  123.         return $this->isProtected;
  124.     }
  125.     public function setIsProtected(?bool $isProtected): self
  126.     {
  127.         $this->isProtected $isProtected;
  128.         return $this;
  129.     }
  130. }