src/Entity/InvoiceType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoiceTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass=InvoiceTypeRepository::class)
  10.  */
  11. class InvoiceType
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({
  18.      *     "invoice.type.base",
  19.      *     "project.details",
  20.      *     "project.details.orders",
  21.      *     "order.detail",
  22.      *
  23.      *     "invoice_type@core",
  24.      *     "invoice_type@base"
  25.      * })
  26.      */ 
  27.     private $id;
  28.     
  29.     /**
  30.      * @ORM\Column(type="string", length=64, unique=true)
  31.      * @Groups({
  32.      *      "invoice.type.base",
  33.      *      "project.details",
  34.      *      "project.details.orders",
  35.      *      "order.detail",
  36.      *
  37.      *      "invoice_type@core",
  38.      *      "invoice_type@base"
  39.      * })
  40.      */
  41.     private $name;
  42.     
  43.     /**
  44.      * @ORM\Column(type="string", length=255)
  45.      */
  46.     private $description;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=ProjectOrders::class, mappedBy="invoice_type")
  49.      */
  50.     private $projectOrders;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=Projects::class, mappedBy="invoice_type")
  53.      */
  54.     private $projects;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=Invoices::class, mappedBy="invoice_type")
  57.      */
  58.     private $invoices;
  59.     /**
  60.      * @ORM\Column(type="string", length=32, nullable=true)
  61.      * @Groups({
  62.      *     "invoice_type@core",
  63.      *     "invoice_type@base"
  64.      * })
  65.      */
  66.     private $severity;
  67.     public function __construct()
  68.     {
  69.         $this->projectOrders = new ArrayCollection();
  70.         $this->projects = new ArrayCollection();
  71.         $this->invoices = new ArrayCollection();
  72.     }
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getName(): ?string
  78.     {
  79.         return $this->name;
  80.     }
  81.     public function setName(string $name): self
  82.     {
  83.         $this->name $name;
  84.         return $this;
  85.     }
  86.     public function getDescription(): ?string
  87.     {
  88.         return $this->description;
  89.     }
  90.     public function setDescription(string $description): self
  91.     {
  92.         $this->description $description;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return Collection<int, ProjectOrders>
  97.      */
  98.     public function getProjectOrders(): Collection
  99.     {
  100.         return $this->projectOrders;
  101.     }
  102.     public function addProjectOrder(ProjectOrders $projectOrder): self
  103.     {
  104.         if (!$this->projectOrders->contains($projectOrder)) {
  105.             $this->projectOrders[] = $projectOrder;
  106.             $projectOrder->setInvoiceType($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeProjectOrder(ProjectOrders $projectOrder): self
  111.     {
  112.         if ($this->projectOrders->removeElement($projectOrder)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($projectOrder->getInvoiceType() === $this) {
  115.                 $projectOrder->setInvoiceType(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return Collection<int, Projects>
  122.      */
  123.     public function getProjects(): Collection
  124.     {
  125.         return $this->projects;
  126.     }
  127.     public function addProject(Projects $project): self
  128.     {
  129.         if (!$this->projects->contains($project)) {
  130.             $this->projects[] = $project;
  131.             $project->setInvoiceType($this);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeProject(Projects $project): self
  136.     {
  137.         if ($this->projects->removeElement($project)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($project->getInvoiceType() === $this) {
  140.                 $project->setInvoiceType(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145.     /**
  146.      * @return Collection<int, Invoices>
  147.      */
  148.     public function getInvoices(): Collection
  149.     {
  150.         return $this->invoices;
  151.     }
  152.     public function addInvoice(Invoices $invoice): self
  153.     {
  154.         if (!$this->invoices->contains($invoice)) {
  155.             $this->invoices[] = $invoice;
  156.             $invoice->setInvoiceType($this);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeInvoice(Invoices $invoice): self
  161.     {
  162.         if ($this->invoices->removeElement($invoice)) {
  163.             // set the owning side to null (unless already changed)
  164.             if ($invoice->getInvoiceType() === $this) {
  165.                 $invoice->setInvoiceType(null);
  166.             }
  167.         }
  168.         return $this;
  169.     }
  170.     public function getSeverity(): ?string
  171.     {
  172.         return $this->severity;
  173.     }
  174.     public function setSeverity(?string $severity): self
  175.     {
  176.         $this->severity $severity;
  177.         return $this;
  178.     }
  179. }