<?php
namespace App\Entity;
use App\Repository\TacheRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TacheRepository::class)
*/
class Tache
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $wording;
/**
* @ORM\OneToMany(targetEntity=DemandeByCanal::class, mappedBy="tache")
*/
private $demandeByCanals;
public function __construct()
{
$this->demandeByCanals = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->wording;
}
public function setWording(string $wording): self
{
$this->wording = $wording;
return $this;
}
/**
* @return Collection<int, DemandeByCanal>
*/
public function getDemandeByCanals(): Collection
{
return $this->demandeByCanals;
}
public function addDemandeByCanal(DemandeByCanal $demandeByCanal): self
{
if (!$this->demandeByCanals->contains($demandeByCanal)) {
$this->demandeByCanals[] = $demandeByCanal;
$demandeByCanal->setTache($this);
}
return $this;
}
public function removeDemandeByCanal(DemandeByCanal $demandeByCanal): self
{
if ($this->demandeByCanals->removeElement($demandeByCanal)) {
// set the owning side to null (unless already changed)
if ($demandeByCanal->getTache() === $this) {
$demandeByCanal->setTache(null);
}
}
return $this;
}
}