src/Entity/LabelNR.php line 11
<?php
namespace App\Entity;
use App\Repository\LabelNRRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LabelNRRepository::class)]
class LabelNR
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\OneToMany(mappedBy: 'LabelNR', targetEntity: LabelNRAxe::class, orphanRemoval: true)]
private Collection $axes;
public function __construct()
{
$this->axes = new ArrayCollection();
}
public function __toString()
{
return $this->name;
}
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;
}
/**
* @return Collection<int, LabelNRAxe>
*/
public function getAxes(): Collection
{
return $this->axes;
}
public function addAxe(LabelNRAxe $axe): self
{
if (!$this->axes->contains($axe)) {
$this->axes->add($axe);
$axe->setLabelNR($this);
}
return $this;
}
public function removeAxe(LabelNRAxe $axe): self
{
if ($this->axes->removeElement($axe)) {
// set the owning side to null (unless already changed)
if ($axe->getLabelNR() === $this) {
$axe->setLabelNR(null);
}
}
return $this;
}
}