src/Entity/Annee.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AnneeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassAnneeRepository::class)]
  8. class Annee
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length100)]
  15.     private ?string $libelle null;
  16.     #[ORM\OneToMany(mappedBy'annee'targetEntityMois::class)]
  17.     private Collection $mois;
  18.     #[ORM\OneToMany(mappedBy'annee'targetEntityPayment::class)]
  19.     private Collection $payments;
  20.     #[ORM\Column(nullabletrue)]
  21.     private ?bool $isGenerate null;
  22.     #[ORM\ManyToMany(targetEntityEntreprise::class, inversedBy'annees')]
  23.     private Collection $marchand;
  24.     #[ORM\OneToMany(mappedBy'year'targetEntityPaymentGenerator::class)]
  25.     private Collection $paymentGenerators;
  26.     public function __construct()
  27.     {
  28.         $this->mois = new ArrayCollection();
  29.         $this->payments = new ArrayCollection();
  30.         $this->marchand = new ArrayCollection();
  31.         $this->paymentGenerators = new ArrayCollection();
  32.     }
  33.     /**
  34.      * @return int|null
  35.      */
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     /**
  41.      * @param int|null $id
  42.      */
  43.     public function setId(?int $id): void
  44.     {
  45.         $this->id $id;
  46.     }
  47.     /**
  48.      * @return string|null
  49.      */
  50.     public function getLibelle(): ?string
  51.     {
  52.         return $this->libelle;
  53.     }
  54.     /**
  55.      * @param string|null $libelle
  56.      */
  57.     public function setLibelle(?string $libelle): void
  58.     {
  59.         $this->libelle $libelle;
  60.     }
  61.     /**
  62.      * @return ArrayCollection|Collection
  63.      */
  64.     public function getMois(): ArrayCollection|Collection
  65.     {
  66.         return $this->mois;
  67.     }
  68.     /**
  69.      * @param ArrayCollection|Collection $mois
  70.      */
  71.     public function setMois(ArrayCollection|Collection $mois): void
  72.     {
  73.         $this->mois $mois;
  74.     }
  75.     /**
  76.      * @return ArrayCollection|Collection
  77.      */
  78.     public function getPayments(): ArrayCollection|Collection
  79.     {
  80.         return $this->payments;
  81.     }
  82.     /**
  83.      * @param ArrayCollection|Collection $payments
  84.      */
  85.     public function setPayments(ArrayCollection|Collection $payments): void
  86.     {
  87.         $this->payments $payments;
  88.     }
  89.     /**
  90.      * @return bool|null
  91.      */
  92.     public function getIsGenerate(): ?bool
  93.     {
  94.         return $this->isGenerate;
  95.     }
  96.     /**
  97.      * @param bool|null $isGenerate
  98.      */
  99.     public function setIsGenerate(?bool $isGenerate): void
  100.     {
  101.         $this->isGenerate $isGenerate;
  102.     }
  103.     /**
  104.      * @return ArrayCollection|Collection
  105.      */
  106.     public function getMarchand(): ArrayCollection|Collection
  107.     {
  108.         return $this->marchand;
  109.     }
  110.     /**
  111.      * @param ArrayCollection|Collection $marchand
  112.      */
  113.     public function setMarchand(ArrayCollection|Collection $marchand): void
  114.     {
  115.         $this->marchand $marchand;
  116.     }
  117.     public function __toString()
  118.     {
  119.         return $this->libelle;
  120.     }
  121.     /**
  122.      * @return Collection<int, PaymentGenerator>
  123.      */
  124.     public function getPaymentGenerators(): Collection
  125.     {
  126.         return $this->paymentGenerators;
  127.     }
  128.     public function addPaymentGenerator(PaymentGenerator $paymentGenerator): static
  129.     {
  130.         if (!$this->paymentGenerators->contains($paymentGenerator)) {
  131.             $this->paymentGenerators->add($paymentGenerator);
  132.             $paymentGenerator->setYear($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removePaymentGenerator(PaymentGenerator $paymentGenerator): static
  137.     {
  138.         if ($this->paymentGenerators->removeElement($paymentGenerator)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($paymentGenerator->getYear() === $this) {
  141.                 $paymentGenerator->setYear(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146. }