src/Entity/DonneePerformance.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DonneePerformanceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassDonneePerformanceRepository::class)]
  10. class DonneePerformance
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  17.     #[Assert\NotNull(message'La date de publication des données doit être renseignée')]
  18.     private ?\DateTimeInterface $datePublicationDonneesExecution null;
  19.     #[ORM\Column(typeTypes::DECIMALprecision20scale2)]
  20.     #[Assert\Type(type'numeric'message'Le montant de la dépense doit être un nombre.')]
  21.     #[Assert\NotNull(message'Les dépenses doivent être renseignées')]
  22.     private ?string $depenseInvestissement null;
  23.     #[ORM\OneToMany(mappedBy'donneePerformance'targetEntityTarifUsager::class, cascade: ['persist'])]
  24.     private Collection $tarifUsager;
  25.     #[ORM\ManyToOne(targetEntity:Concession::class ,inversedBy'donneePerformance')]
  26.     #[ORM\JoinColumn(name:'concession_id'referencedColumnName'id'nullabletrue)]
  27.     private ?Concession $concession null;
  28.     public function __construct()
  29.     {
  30.         $this->tarifUsager = new ArrayCollection();
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getDatePublicationDonneesExecution(): ?\DateTimeInterface
  37.     {
  38.         return $this->datePublicationDonneesExecution;
  39.     }
  40.     public function setDatePublicationDonneesExecution(\DateTimeInterface $datePublicationDonneesExecution): static
  41.     {
  42.         $this->datePublicationDonneesExecution $datePublicationDonneesExecution;
  43.         return $this;
  44.     }
  45.     public function getDepenseInvestissement(): ?string
  46.     {
  47.         return $this->depenseInvestissement;
  48.     }
  49.     public function setDepenseInvestissement(string $depenseInvestissement): static
  50.     {
  51.         $this->depenseInvestissement $depenseInvestissement;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return Collection<int, TarifUsager>
  56.      */
  57.     public function getTarifUsager(): Collection
  58.     {
  59.         return $this->tarifUsager;
  60.     }
  61.     public function addTarifUsager(TarifUsager $tarifUsager): static
  62.     {
  63.         if (!$this->tarifUsager->contains($tarifUsager)) {
  64.             $this->tarifUsager->add($tarifUsager);
  65.             $tarifUsager->setDonneePerformance($this);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removeTarifUsager(TarifUsager $tarifUsager): static
  70.     {
  71.         if ($this->tarifUsager->removeElement($tarifUsager)) {
  72.             // set the owning side to null (unless already changed)
  73.             if ($tarifUsager->getDonneePerformance() === $this) {
  74.                 $tarifUsager->setDonneePerformance(null);
  75.             }
  76.         }
  77.         return $this;
  78.     }
  79.     public function getConcession(): ?Concession
  80.     {
  81.         return $this->concession;
  82.     }
  83.     public function setConcession(?Concession $concession): static
  84.     {
  85.         $this->concession $concession;
  86.         return $this;
  87.     }
  88. }