src/Entity/InvoiceInterval.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoiceIntervalRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassInvoiceIntervalRepository::class)]
  8. class InvoiceInterval
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column]
  15.     private ?int $value null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $name null;
  18.     #[ORM\ManyToMany(targetEntityCustomerInvoiceSettings::class, mappedBy'invoiceIntervals')]
  19.     private ?Collection $customerInvoiceSettings;
  20.     public function __construct()
  21.     {
  22.         $this->customerInvoiceSettings = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getValue(): ?int
  29.     {
  30.         return $this->value;
  31.     }
  32.     public function setValue(int $value): self
  33.     {
  34.         $this->value $value;
  35.         return $this;
  36.     }
  37.     public function getName(): ?string
  38.     {
  39.         return $this->name;
  40.     }
  41.     public function setName(string $name): self
  42.     {
  43.         $this->name $name;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, CustomerInvoiceSettings>
  48.      */
  49.     public function getCustomerInvoiceSettings(): Collection
  50.     {
  51.         return $this->customerInvoiceSettings;
  52.     }
  53.     public function addCustomerInvoiceSetting(CustomerInvoiceSettings $customerInvoiceSetting): self
  54.     {
  55.         if (!$this->customerInvoiceSettings->contains($customerInvoiceSetting)) {
  56.             $this->customerInvoiceSettings->add($customerInvoiceSetting);
  57.             $customerInvoiceSetting->addInvoiceInterval($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeCustomerInvoiceSetting(CustomerInvoiceSettings $customerInvoiceSetting): self
  62.     {
  63.         if ($this->customerInvoiceSettings->removeElement($customerInvoiceSetting)) {
  64.             $customerInvoiceSetting->removeInvoiceInterval($this);
  65.         }
  66.         return $this;
  67.     }
  68. }