src/Entity/CompanyIndicatorThematic.php line 12
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\UX\Chartjs\Model\Chart;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use App\Repository\CompanyIndicatorThematicRepository;
#[ORM\Entity(repositoryClass: CompanyIndicatorThematicRepository::class)]
class CompanyIndicatorThematic
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Thematic $thematic = null;
#[ORM\ManyToOne(inversedBy: 'companyIndicatorThematics')]
#[ORM\JoinColumn(nullable: false)]
private ?Company $company = null;
#[ORM\Column]
private ?bool $active = null;
#[ORM\OneToMany(mappedBy: 'companyIndicatorThematic', targetEntity: CompanyIndicator::class, orphanRemoval: true)]
private Collection $companyIndicators;
private Chart $chart;
private ?array $datas;
public function __construct(Company $company, Thematic $thematic)
{
$this->company = $company;
$this->thematic = $thematic;
$this->active = true;
$this->companyIndicators = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getThematic(): ?Thematic
{
return $this->thematic;
}
public function setThematic(?Thematic $thematic): self
{
$this->thematic = $thematic;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
/**
* @return Collection<int, CompanyIndicator>
*/
public function getCompanyIndicators(): Collection
{
return $this->companyIndicators;
}
public function addCompanyIndicator(CompanyIndicator $companyIndicator): self
{
if (!$this->companyIndicators->contains($companyIndicator)) {
$this->companyIndicators->add($companyIndicator);
$companyIndicator->setCompanyIndicatorThematic($this);
}
return $this;
}
public function removeCompanyIndicator(CompanyIndicator $companyIndicator): self
{
if ($this->companyIndicators->removeElement($companyIndicator)) {
// set the owning side to null (unless already changed)
if ($companyIndicator->getCompanyIndicatorThematic() === $this) {
$companyIndicator->setCompanyIndicatorThematic(null);
}
}
return $this;
}
public function getChart(): ?Chart
{
return $this->chart;
}
public function setChart(Chart $chart): self
{
$this->chart = $chart;
return $this;
}
public function getDatas(): ?array
{
return $this->datas;
}
public function setDatas(array $datas): self
{
$this->datas = $datas;
return $this;
}
}