src/Entity/CompanyIndicatorThematic.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\UX\Chartjs\Model\Chart;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use App\Repository\CompanyIndicatorThematicRepository;
  8. #[ORM\Entity(repositoryClassCompanyIndicatorThematicRepository::class)]
  9. class CompanyIndicatorThematic
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\ManyToOne]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?Thematic $thematic null;
  18.     #[ORM\ManyToOne(inversedBy'companyIndicatorThematics')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Company $company null;
  21.     #[ORM\Column]
  22.     private ?bool $active null;
  23.     #[ORM\OneToMany(mappedBy'companyIndicatorThematic'targetEntityCompanyIndicator::class, orphanRemovaltrue)]
  24.     private Collection $companyIndicators;
  25.     private Chart $chart;
  26.     private ?array $datas;
  27.     public function __construct(Company $companyThematic $thematic)
  28.     {
  29.         $this->company $company;
  30.         $this->thematic $thematic;
  31.         $this->active true;
  32.         $this->companyIndicators = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getThematic(): ?Thematic
  39.     {
  40.         return $this->thematic;
  41.     }
  42.     public function setThematic(?Thematic $thematic): self
  43.     {
  44.         $this->thematic $thematic;
  45.         return $this;
  46.     }
  47.     public function getCompany(): ?Company
  48.     {
  49.         return $this->company;
  50.     }
  51.     public function setCompany(?Company $company): self
  52.     {
  53.         $this->company $company;
  54.         return $this;
  55.     }
  56.     public function isActive(): ?bool
  57.     {
  58.         return $this->active;
  59.     }
  60.     public function setActive(bool $active): self
  61.     {
  62.         $this->active $active;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection<int, CompanyIndicator>
  67.      */
  68.     public function getCompanyIndicators(): Collection
  69.     {
  70.         return $this->companyIndicators;
  71.     }
  72.     public function addCompanyIndicator(CompanyIndicator $companyIndicator): self
  73.     {
  74.         if (!$this->companyIndicators->contains($companyIndicator)) {
  75.             $this->companyIndicators->add($companyIndicator);
  76.             $companyIndicator->setCompanyIndicatorThematic($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeCompanyIndicator(CompanyIndicator $companyIndicator): self
  81.     {
  82.         if ($this->companyIndicators->removeElement($companyIndicator)) {
  83.             // set the owning side to null (unless already changed)
  84.             if ($companyIndicator->getCompanyIndicatorThematic() === $this) {
  85.                 $companyIndicator->setCompanyIndicatorThematic(null);
  86.             }
  87.         }
  88.         return $this;
  89.     }
  90.     public function getChart(): ?Chart
  91.     {
  92.         return $this->chart;
  93.     }
  94.     public function setChart(Chart $chart): self
  95.     {
  96.         $this->chart $chart;
  97.         return $this;
  98.     }
  99.     public function getDatas(): ?array
  100.     {
  101.         return $this->datas;
  102.     }
  103.     public function setDatas(array $datas): self
  104.     {
  105.         $this->datas $datas;
  106.         return $this;
  107.     }
  108. }