src/Entity/BlocRh.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BlocRhRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBlocRhRepository::class)]
  8. class BlocRh
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\ManyToOne(inversedBy'blocRhs')]
  15.     private ?FicheRh $bloc_rh null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $titre null;
  18.     #[ORM\OneToMany(mappedBy'element_rh'targetEntityElementRh::class)]
  19.     private Collection $elementRhs;
  20.     public function __construct()
  21.     {
  22.         $this->elementRhs = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getBlocRh(): ?FicheRh
  29.     {
  30.         return $this->bloc_rh;
  31.     }
  32.     public function setBlocRh(?FicheRh $bloc_rh): self
  33.     {
  34.         $this->bloc_rh $bloc_rh;
  35.         return $this;
  36.     }
  37.     public function getTitre(): ?string
  38.     {
  39.         return $this->titre;
  40.     }
  41.     public function setTitre(string $titre): self
  42.     {
  43.         $this->titre $titre;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, ElementRh>
  48.      */
  49.     public function getElementRhs(): Collection
  50.     {
  51.         return $this->elementRhs;
  52.     }
  53.     public function addElementRh(ElementRh $elementRh): self
  54.     {
  55.         if (!$this->elementRhs->contains($elementRh)) {
  56.             $this->elementRhs->add($elementRh);
  57.             $elementRh->setElementRh($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeElementRh(ElementRh $elementRh): self
  62.     {
  63.         if ($this->elementRhs->removeElement($elementRh)) {
  64.             // set the owning side to null (unless already changed)
  65.             if ($elementRh->getElementRh() === $this) {
  66.                 $elementRh->setElementRh(null);
  67.             }
  68.         }
  69.         return $this;
  70.     }
  71. }