src/Entity/Baskets.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BasketsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBasketsRepository::class)]
  8. class Baskets
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityClinics::class, inversedBy'baskets')]
  15.     private $clinic;
  16.     #[ORM\Column(type'float'nullabletrue)]
  17.     private $total;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $name;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $savedBy;
  22.     #[ORM\Column(type'string'length255)]
  23.     private $status;
  24.     #[ORM\Column(type'datetime')]
  25.     private $modified;
  26.     #[ORM\Column(type'datetime')]
  27.     private $created;
  28.     #[ORM\OneToMany(targetEntityBasketItems::class, mappedBy'basket')]
  29.     private $basketItems;
  30.     #[ORM\OneToOne(targetEntityOrders::class, mappedBy'basket'cascade: ['persist''remove'])]
  31.     private $orders;
  32.     #[ORM\Column(type'integer'nullabletrue)]
  33.     private $isDefault;
  34.     public function __construct()
  35.     {
  36.         $this->setModified(new \DateTime());
  37.         if ($this->getCreated() == null) {
  38.             $this->setCreated(new \DateTime());
  39.         }
  40.         $this->basketItems = new ArrayCollection();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getClinic(): ?Clinics
  47.     {
  48.         return $this->clinic;
  49.     }
  50.     public function setClinic(?Clinics $clinic): self
  51.     {
  52.         $this->clinic $clinic;
  53.         return $this;
  54.     }
  55.     public function getTotal(): ?float
  56.     {
  57.         return $this->total;
  58.     }
  59.     public function setTotal(?float $total): self
  60.     {
  61.         $this->total $total;
  62.         return $this;
  63.     }
  64.     public function getName(): ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(string $name): self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     public function getSavedBy(): ?string
  74.     {
  75.         return $this->savedBy;
  76.     }
  77.     public function setSavedBy(string $savedBy): self
  78.     {
  79.         $this->savedBy $savedBy;
  80.         return $this;
  81.     }
  82.     public function getStatus(): ?string
  83.     {
  84.         return $this->status;
  85.     }
  86.     public function setStatus(string $status): self
  87.     {
  88.         $this->status $status;
  89.         return $this;
  90.     }
  91.     public function getModified(): ?\DateTimeInterface
  92.     {
  93.         return $this->modified;
  94.     }
  95.     public function setModified(\DateTimeInterface $modified): self
  96.     {
  97.         $this->modified $modified;
  98.         return $this;
  99.     }
  100.     public function getCreated(): ?\DateTimeInterface
  101.     {
  102.         return $this->created;
  103.     }
  104.     public function setCreated(\DateTimeInterface $created): self
  105.     {
  106.         $this->created $created;
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return Collection<int, BasketItems>
  111.      */
  112.     public function getBasketItems(): Collection
  113.     {
  114.         return $this->basketItems;
  115.     }
  116.     public function addBasketItem(BasketItems $basketItem): self
  117.     {
  118.         if (!$this->basketItems->contains($basketItem)) {
  119.             $this->basketItems[] = $basketItem;
  120.             $basketItem->setBasket($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeBasketItem(BasketItems $basketItem): self
  125.     {
  126.         if ($this->basketItems->removeElement($basketItem)) {
  127.             // set the owning side to null (unless already changed)
  128.             if ($basketItem->getBasket() === $this) {
  129.                 $basketItem->setBasket(null);
  130.             }
  131.         }
  132.         return $this;
  133.     }
  134.     public function getOrders(): ?Orders
  135.     {
  136.         return $this->orders;
  137.     }
  138.     public function setOrders(Orders $orders): self
  139.     {
  140.         // set the owning side of the relation if necessary
  141.         if ($orders->getBasket() !== $this) {
  142.             $orders->setBasket($this);
  143.         }
  144.         $this->orders $orders;
  145.         return $this;
  146.     }
  147.     public function getIsDefault(): ?int
  148.     {
  149.         return $this->isDefault;
  150.     }
  151.     public function setIsDefault(?int $isDefault): self
  152.     {
  153.         $this->isDefault $isDefault;
  154.         return $this;
  155.     }
  156. }