<?php
namespace App\Entity;
use App\Repository\InvoiceIntervalRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: InvoiceIntervalRepository::class)]
class InvoiceInterval
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $value = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToMany(targetEntity: CustomerInvoiceSettings::class, mappedBy: 'invoiceIntervals')]
private ?Collection $customerInvoiceSettings;
public function __construct()
{
$this->customerInvoiceSettings = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getValue(): ?int
{
return $this->value;
}
public function setValue(int $value): self
{
$this->value = $value;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, CustomerInvoiceSettings>
*/
public function getCustomerInvoiceSettings(): Collection
{
return $this->customerInvoiceSettings;
}
public function addCustomerInvoiceSetting(CustomerInvoiceSettings $customerInvoiceSetting): self
{
if (!$this->customerInvoiceSettings->contains($customerInvoiceSetting)) {
$this->customerInvoiceSettings->add($customerInvoiceSetting);
$customerInvoiceSetting->addInvoiceInterval($this);
}
return $this;
}
public function removeCustomerInvoiceSetting(CustomerInvoiceSettings $customerInvoiceSetting): self
{
if ($this->customerInvoiceSettings->removeElement($customerInvoiceSetting)) {
$customerInvoiceSetting->removeInvoiceInterval($this);
}
return $this;
}
}