<?php
namespace App\Entity;
use App\Repository\EleveurRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EleveurRepository::class)]
class Eleveur
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'eleveurs')]
#[ORM\JoinColumn(nullable: false)]
private ?User $user = null;
#[ORM\ManyToOne(inversedBy: 'eleveurs')]
private ?DicImada $imada = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nprElvAr = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nprElvFr = null;
#[ORM\Column(length: 1, nullable: true)]
private ?string $typeElv = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $identElv = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresse = null;
#[ORM\Column(length: 30, nullable: true)]
private ?string $numTel = null;
#[ORM\Column(nullable: true)]
private ?int $numFax = null;
#[ORM\ManyToOne(inversedBy: 'eleveurs')]
private ?DicGouvernorat $gouvernorat = null;
#[ORM\ManyToOne(inversedBy: 'eleveurs')]
private ?DicDelegation $delegation = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $updatedAt = null;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: Ferme::class)]
private Collection $fermes;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandeUpdate::class)]
private Collection $demandeUpdates;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandeRebouclage::class)]
private Collection $demandeRebouclages;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandeIdentification::class)]
private Collection $demandeIdentifications;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandeAcquisition::class)]
private Collection $demandeAcquisitions;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandePrgAmelioration::class)]
private Collection $demandePrgAmeliorations;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: OperationIdentification::class)]
private Collection $operationIdentifications;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: OperationInsemination::class)]
private Collection $operationInseminations;
#[ORM\ManyToMany(targetEntity: ProgrammeAmelioration::class, mappedBy: 'eleveur')]
private Collection $programmeAmeliorations;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandeEnree::class)]
private Collection $demandeEnrees;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: DemandeSortie::class)]
private Collection $demandeSorties;
#[ORM\Column(length: 100, nullable: true)]
private ?string $codElv = null;
#[ORM\OneToMany(mappedBy: 'eleveur', targetEntity: Animal::class)]
private Collection $animals;
public function __construct()
{
$this->fermes = new ArrayCollection();
$this->demandeUpdates = new ArrayCollection();
$this->demandeRebouclages = new ArrayCollection();
$this->demandeIdentifications = new ArrayCollection();
$this->demandeAcquisitions = new ArrayCollection();
$this->demandePrgAmeliorations = new ArrayCollection();
$this->operationIdentifications = new ArrayCollection();
$this->operationInseminations = new ArrayCollection();
$this->programmeAmeliorations = new ArrayCollection();
$this->demandeEnrees = new ArrayCollection();
$this->demandeSorties = new ArrayCollection();
$this->animals = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getImada(): ?DicImada
{
return $this->imada;
}
public function setImada(?DicImada $imada): self
{
$this->imada = $imada;
return $this;
}
public function getNprElvAr(): ?string
{
return $this->nprElvAr;
}
public function setNprElvAr(?string $nprElvAr): self
{
$this->nprElvAr = $nprElvAr;
return $this;
}
public function getNprElvFr(): ?string
{
return $this->nprElvFr;
}
public function setNprElvFr(?string $nprElvFr): self
{
$this->nprElvFr = $nprElvFr;
return $this;
}
public function getTypeElv(): ?string
{
return $this->typeElv;
}
public function setTypeElv(?string $typeElv): self
{
$this->typeElv = $typeElv;
return $this;
}
public function getIdentElv(): ?string
{
return $this->identElv;
}
public function setIdentElv(?string $identElv): self
{
$this->identElv = $identElv;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getNumTel(): ?string
{
return $this->numTel;
}
public function setNumTel(?string $numTel): self
{
$this->numTel = $numTel;
return $this;
}
public function getNumFax(): ?int
{
return $this->numFax;
}
public function setNumFax(?int $numFax): self
{
$this->numFax = $numFax;
return $this;
}
public function getGouvernorat(): ?DicGouvernorat
{
return $this->gouvernorat;
}
public function setGouvernorat(?DicGouvernorat $gouvernorat): self
{
$this->gouvernorat = $gouvernorat;
return $this;
}
public function getDelegation(): ?DicDelegation
{
return $this->delegation;
}
public function setDelegation(?DicDelegation $delegation): self
{
$this->delegation = $delegation;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return Collection<int, Ferme>
*/
public function getFermes(): Collection
{
return $this->fermes;
}
public function addFerme(Ferme $ferme): self
{
if (!$this->fermes->contains($ferme)) {
$this->fermes[] = $ferme;
$ferme->setEleveur($this);
}
return $this;
}
public function removeFerme(Ferme $ferme): self
{
if ($this->fermes->removeElement($ferme)) {
// set the owning side to null (unless already changed)
if ($ferme->getEleveur() === $this) {
$ferme->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandeUpdate>
*/
public function getDemandeUpdates(): Collection
{
return $this->demandeUpdates;
}
public function addDemandeUpdate(DemandeUpdate $demandeUpdate): self
{
if (!$this->demandeUpdates->contains($demandeUpdate)) {
$this->demandeUpdates[] = $demandeUpdate;
$demandeUpdate->setEleveur($this);
}
return $this;
}
public function removeDemandeUpdate(DemandeUpdate $demandeUpdate): self
{
if ($this->demandeUpdates->removeElement($demandeUpdate)) {
// set the owning side to null (unless already changed)
if ($demandeUpdate->getEleveur() === $this) {
$demandeUpdate->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandeRebouclage>
*/
public function getDemandeRebouclages(): Collection
{
return $this->demandeRebouclages;
}
public function addDemandeRebouclage(DemandeRebouclage $demandeRebouclage): self
{
if (!$this->demandeRebouclages->contains($demandeRebouclage)) {
$this->demandeRebouclages[] = $demandeRebouclage;
$demandeRebouclage->setEleveur($this);
}
return $this;
}
public function removeDemandeRebouclage(DemandeRebouclage $demandeRebouclage): self
{
if ($this->demandeRebouclages->removeElement($demandeRebouclage)) {
// set the owning side to null (unless already changed)
if ($demandeRebouclage->getEleveur() === $this) {
$demandeRebouclage->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandeIdentification>
*/
public function getDemandeIdentifications(): Collection
{
return $this->demandeIdentifications;
}
public function addDemandeIdentification(DemandeIdentification $demandeIdentification): self
{
if (!$this->demandeIdentifications->contains($demandeIdentification)) {
$this->demandeIdentifications[] = $demandeIdentification;
$demandeIdentification->setEleveur($this);
}
return $this;
}
public function removeDemandeIdentification(DemandeIdentification $demandeIdentification): self
{
if ($this->demandeIdentifications->removeElement($demandeIdentification)) {
// set the owning side to null (unless already changed)
if ($demandeIdentification->getEleveur() === $this) {
$demandeIdentification->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandeAcquisition>
*/
public function getDemandeAcquisitions(): Collection
{
return $this->demandeAcquisitions;
}
public function addDemandeAcquisition(DemandeAcquisition $demandeAcquisition): self
{
if (!$this->demandeAcquisitions->contains($demandeAcquisition)) {
$this->demandeAcquisitions[] = $demandeAcquisition;
$demandeAcquisition->setEleveur($this);
}
return $this;
}
public function removeDemandeAcquisition(DemandeAcquisition $demandeAcquisition): self
{
if ($this->demandeAcquisitions->removeElement($demandeAcquisition)) {
// set the owning side to null (unless already changed)
if ($demandeAcquisition->getEleveur() === $this) {
$demandeAcquisition->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandePrgAmelioration>
*/
public function getDemandePrgAmeliorations(): Collection
{
return $this->demandePrgAmeliorations;
}
public function addDemandePrgAmelioration(DemandePrgAmelioration $demandePrgAmelioration): self
{
if (!$this->demandePrgAmeliorations->contains($demandePrgAmelioration)) {
$this->demandePrgAmeliorations[] = $demandePrgAmelioration;
$demandePrgAmelioration->setEleveur($this);
}
return $this;
}
public function removeDemandePrgAmelioration(DemandePrgAmelioration $demandePrgAmelioration): self
{
if ($this->demandePrgAmeliorations->removeElement($demandePrgAmelioration)) {
// set the owning side to null (unless already changed)
if ($demandePrgAmelioration->getEleveur() === $this) {
$demandePrgAmelioration->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, OperationIdentification>
*/
public function getOperationIdentifications(): Collection
{
return $this->operationIdentifications;
}
public function addOperationIdentification(OperationIdentification $operationIdentification): self
{
if (!$this->operationIdentifications->contains($operationIdentification)) {
$this->operationIdentifications[] = $operationIdentification;
$operationIdentification->setEleveur($this);
}
return $this;
}
public function removeOperationIdentification(OperationIdentification $operationIdentification): self
{
if ($this->operationIdentifications->removeElement($operationIdentification)) {
// set the owning side to null (unless already changed)
if ($operationIdentification->getEleveur() === $this) {
$operationIdentification->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, OperationInsemination>
*/
public function getOperationInseminations(): Collection
{
return $this->operationInseminations;
}
public function addOperationInsemination(OperationInsemination $operationInsemination): self
{
if (!$this->operationInseminations->contains($operationInsemination)) {
$this->operationInseminations[] = $operationInsemination;
$operationInsemination->setEleveur($this);
}
return $this;
}
public function removeOperationInsemination(OperationInsemination $operationInsemination): self
{
if ($this->operationInseminations->removeElement($operationInsemination)) {
// set the owning side to null (unless already changed)
if ($operationInsemination->getEleveur() === $this) {
$operationInsemination->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, ProgrammeAmelioration>
*/
public function getProgrammeAmeliorations(): Collection
{
return $this->programmeAmeliorations;
}
public function addProgrammeAmelioration(ProgrammeAmelioration $programmeAmelioration): self
{
if (!$this->programmeAmeliorations->contains($programmeAmelioration)) {
$this->programmeAmeliorations[] = $programmeAmelioration;
$programmeAmelioration->addEleveur($this);
}
return $this;
}
public function removeProgrammeAmelioration(ProgrammeAmelioration $programmeAmelioration): self
{
if ($this->programmeAmeliorations->removeElement($programmeAmelioration)) {
$programmeAmelioration->removeEleveur($this);
}
return $this;
}
/**
* @return Collection<int, DemandeEnree>
*/
public function getDemandeEnrees(): Collection
{
return $this->demandeEnrees;
}
public function addDemandeEnree(DemandeEnree $demandeEnree): self
{
if (!$this->demandeEnrees->contains($demandeEnree)) {
$this->demandeEnrees[] = $demandeEnree;
$demandeEnree->setEleveur($this);
}
return $this;
}
public function removeDemandeEnree(DemandeEnree $demandeEnree): self
{
if ($this->demandeEnrees->removeElement($demandeEnree)) {
// set the owning side to null (unless already changed)
if ($demandeEnree->getEleveur() === $this) {
$demandeEnree->setEleveur(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandeSortie>
*/
public function getDemandeSorties(): Collection
{
return $this->demandeSorties;
}
public function addDemandeSorty(DemandeSortie $demandeSorty): self
{
if (!$this->demandeSorties->contains($demandeSorty)) {
$this->demandeSorties[] = $demandeSorty;
$demandeSorty->setEleveur($this);
}
return $this;
}
public function removeDemandeSorty(DemandeSortie $demandeSorty): self
{
if ($this->demandeSorties->removeElement($demandeSorty)) {
// set the owning side to null (unless already changed)
if ($demandeSorty->getEleveur() === $this) {
$demandeSorty->setEleveur(null);
}
}
return $this;
}
public function getCodElv(): ?string
{
return $this->codElv;
}
public function setCodElv(?string $codElv): self
{
$this->codElv = $codElv;
return $this;
}
/**
* @return Collection<int, Animal>
*/
public function getAnimals(): Collection
{
return $this->animals;
}
public function addAnimal(Animal $animal): self
{
if (!$this->animals->contains($animal)) {
$this->animals[] = $animal;
$animal->setEleveur($this);
}
return $this;
}
public function removeAnimal(Animal $animal): self
{
if ($this->animals->removeElement($animal)) {
// set the owning side to null (unless already changed)
if ($animal->getEleveur() === $this) {
$animal->setEleveur(null);
}
}
return $this;
}
}