<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\QualiteRepository")
*/
class Qualite
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\SousJacent", mappedBy="qualite")
*/
private $sousJacents;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
public function __construct()
{
$this->sousJacents = new ArrayCollection();
$this->createdAt = new \DateTime('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection|SousJacent[]
*/
public function getSousJacents(): Collection
{
return $this->sousJacents;
}
public function addSousJacent(SousJacent $sousJacent): self
{
if (!$this->sousJacents->contains($sousJacent)) {
$this->sousJacents[] = $sousJacent;
$sousJacent->setQualite($this);
}
return $this;
}
public function removeSousJacent(SousJacent $sousJacent): self
{
if ($this->sousJacents->contains($sousJacent)) {
$this->sousJacents->removeElement($sousJacent);
// set the owning side to null (unless already changed)
if ($sousJacent->getQualite() === $this) {
$sousJacent->setQualite(null);
}
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function __toString(): string
{
return $this->name;
}
}