src/Entity/Status.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassStatusRepository::class)]
  8. class Status
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $status;
  16.     #[ORM\Column(type'datetime')]
  17.     private $modified;
  18.     #[ORM\Column(type'datetime')]
  19.     private $created;
  20.     #[ORM\OneToMany(targetEntityEventLog::class, mappedBy'status')]
  21.     private $eventLogs;
  22.     #[ORM\OneToMany(targetEntityOrderStatus::class, mappedBy'status')]
  23.     private $orderStatuses;
  24.     public function __construct()
  25.     {
  26.         $this->orders = new ArrayCollection();
  27.         $this->eventLogs = new ArrayCollection();
  28.         $this->orderStatuses = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getStatus(): ?string
  35.     {
  36.         return $this->status;
  37.     }
  38.     public function setStatus(string $status): self
  39.     {
  40.         $this->status $status;
  41.         return $this;
  42.     }
  43.     public function getModified(): ?\DateTimeInterface
  44.     {
  45.         return $this->modified;
  46.     }
  47.     public function setModified(\DateTimeInterface $modified): self
  48.     {
  49.         $this->modified $modified;
  50.         return $this;
  51.     }
  52.     public function getCreated(): ?\DateTimeInterface
  53.     {
  54.         return $this->created;
  55.     }
  56.     public function setCreated(\DateTimeInterface $created): self
  57.     {
  58.         $this->created $created;
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection|Orders[]
  63.      */
  64.     public function getOrders(): Collection
  65.     {
  66.         return $this->orders;
  67.     }
  68.     public function addOrder(Orders $order): self
  69.     {
  70.         if (!$this->orders->contains($order)) {
  71.             $this->orders[] = $order;
  72.             $order->setStatus($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeOrder(Orders $order): self
  77.     {
  78.         if ($this->orders->removeElement($order)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($order->getStatus() === $this) {
  81.                 $order->setStatus(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86.     /**
  87.      * @return Collection|EventLog[]
  88.      */
  89.     public function getEventLogs(): Collection
  90.     {
  91.         return $this->eventLogs;
  92.     }
  93.     public function addEventLog(EventLog $eventLog): self
  94.     {
  95.         if (!$this->eventLogs->contains($eventLog)) {
  96.             $this->eventLogs[] = $eventLog;
  97.             $eventLog->setStatus($this);
  98.         }
  99.         return $this;
  100.     }
  101.     public function removeEventLog(EventLog $eventLog): self
  102.     {
  103.         if ($this->eventLogs->removeElement($eventLog)) {
  104.             // set the owning side to null (unless already changed)
  105.             if ($eventLog->getStatus() === $this) {
  106.                 $eventLog->setStatus(null);
  107.             }
  108.         }
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return Collection<int, OrderStatus>
  113.      */
  114.     public function getOrderStatuses(): Collection
  115.     {
  116.         return $this->orderStatuses;
  117.     }
  118.     public function addOrderStatus(OrderStatus $orderStatus): self
  119.     {
  120.         if (!$this->orderStatuses->contains($orderStatus)) {
  121.             $this->orderStatuses[] = $orderStatus;
  122.             $orderStatus->setStatus($this);
  123.         }
  124.         return $this;
  125.     }
  126.     public function removeOrderStatus(OrderStatus $orderStatus): self
  127.     {
  128.         if ($this->orderStatuses->removeElement($orderStatus)) {
  129.             // set the owning side to null (unless already changed)
  130.             if ($orderStatus->getStatus() === $this) {
  131.                 $orderStatus->setStatus(null);
  132.             }
  133.         }
  134.         return $this;
  135.     }
  136. }