src/Entity/Gos/NoTaxType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\NoTaxTypeRepository")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class NoTaxType
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="boolean", nullable=true)
  20.      */
  21.     private $isActive;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $name;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Orders", mappedBy="noTaxType")
  28.      */
  29.     private $orders;
  30.     /**
  31.      * @ORM\Column(type="datetime")
  32.      */
  33.     private $createdAt;
  34.     /**
  35.      * @ORM\Column(type="datetime", nullable=true)
  36.      */
  37.     private $updatedAt;
  38.     public function __construct()
  39.     {
  40.         $this->orders = new ArrayCollection();
  41.     }
  42.     /** @ORM\PrePersist() */
  43.     public function onPrePersist()
  44.     {
  45.         $this->createdAt = new \DateTime();
  46.     }
  47.     /** @ORM\PreUpdate() */
  48.     public function onPreUpdate()
  49.     {
  50.         $this->updatedAt = new \DateTime();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getName(): ?string
  57.     {
  58.         return $this->name;
  59.     }
  60.     public function setName(?string $name): self
  61.     {
  62.         $this->name $name;
  63.         return $this;
  64.     }
  65.     public function getIsActive(): ?bool
  66.     {
  67.         return $this->isActive;
  68.     }
  69.     public function setIsActive(?bool $isActive): self
  70.     {
  71.         $this->isActive $isActive;
  72.         return $this;
  73.     }
  74.     public function getCreatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->createdAt;
  77.     }
  78.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  79.     {
  80.         $this->createdAt $createdAt;
  81.         return $this;
  82.     }
  83.     public function getUpdatedAt(): ?\DateTimeInterface
  84.     {
  85.         return $this->updatedAt;
  86.     }
  87.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  88.     {
  89.         $this->updatedAt $updatedAt;
  90.         return $this;
  91.     }
  92.     /**
  93.      * @return Collection|Orders[]
  94.      */
  95.     public function getOrders(): Collection
  96.     {
  97.         return $this->orders;
  98.     }
  99.     public function addOrder(Orders $order): self
  100.     {
  101.         if (!$this->orders->contains($order)) {
  102.             $this->orders[] = $order;
  103.             $order->setNoTaxType($this);
  104.         }
  105.         return $this;
  106.     }
  107.     public function removeOrder(Orders $order): self
  108.     {
  109.         if ($this->orders->contains($order)) {
  110.             $this->orders->removeElement($order);
  111.             // set the owning side to null (unless already changed)
  112.             if ($order->getNoTaxType() === $this) {
  113.                 $order->setNoTaxType(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118. }