<?php
namespace App\Entity;
use App\Repository\QuotasProductFreeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=QuotasProductFreeRepository::class)
*/
class QuotasProductFree
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\Column(type="boolean")
*/
private bool $enabled = true;
/**
* @ORM\Column(type="string", length=255)
*/
private ?string $label = null;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $quotasMonthInterval = null;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTimeInterface $dateStart = null;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTimeInterface $dateEnd = null;
/**
* @ORM\ManyToMany(targetEntity=User::class, inversedBy="quotaProductFrees")
*
* @var Collection<int, User>
*/
private Collection $users;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $jobs = null;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $roles = null;
/**
* @ORM\Column(type="integer")
*/
private ?int $quota = null;
/**
* @ORM\ManyToOne(targetEntity=CustomProduct::class, inversedBy="quotaProductFrees")
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*/
private ?CustomProduct $customProduct = null;
public function __construct()
{
$this->users = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function isEnabled(): bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getQuotasMonthInterval(): ?int
{
return $this->quotasMonthInterval;
}
public function setQuotasMonthInterval(?int $quotasMonthInterval): self
{
$this->quotasMonthInterval = $quotasMonthInterval;
return $this;
}
public function getDateStart(): ?\DateTimeInterface
{
return $this->dateStart;
}
public function setDateStart(?\DateTimeInterface $dateStart): self
{
$this->dateStart = $dateStart;
return $this;
}
public function getDateEnd(): ?\DateTimeInterface
{
return $this->dateEnd;
}
public function setDateEnd(?\DateTimeInterface $dateEnd): self
{
$this->dateEnd = $dateEnd;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users->add($user);
$user->addQuotaProductFree($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
$user->removeQuotaProductFree($this);
}
return $this;
}
public function getJobs(): ?string
{
return $this->jobs;
}
public function setJobs(?string $jobs): self
{
$this->jobs = $jobs;
return $this;
}
public function getRoles(): ?string
{
return $this->roles;
}
public function setRoles(?string $roles): self
{
$this->roles = $roles;
return $this;
}
public function getQuota(): ?int
{
return $this->quota;
}
public function setQuota(int $quota): self
{
$this->quota = $quota;
return $this;
}
public function getCustomProduct(): ?CustomProduct
{
return $this->customProduct;
}
public function setCustomProduct(?CustomProduct $customProduct): self
{
$this->customProduct = $customProduct;
return $this;
}
}