src/Entity/Gestiform/Formations/Catalogue/Theme/SousTheme.php line 16

  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Catalogue\Theme;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Upload;
  5. use App\Repository\Gestiform\Formations\Catalogue\Theme\SousThemeRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassSousThemeRepository::class)]
  11. class SousTheme extends AbstractEntity
  12. {
  13.     #[ORM\Column(type'string'length255nullablefalse)]
  14.     private string $intitule;
  15.     #[ORM\JoinColumn(nullabletrue)]
  16.     #[ORM\OneToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  17.     private ?Upload $photo null;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private ?string $alt null;
  20.     #[ORM\OneToMany(mappedBy'sousTheme'targetEntitySousThemeTheme::class)]
  21.     private Collection $sousThemeThemes;
  22.     public function __construct()
  23.     {
  24.         $this->sousThemeThemes = new ArrayCollection();
  25.     }
  26.     public function getIntitule(): ?string
  27.     {
  28.         return $this->intitule;
  29.     }
  30.     public function setIntitule(string $intitule): self
  31.     {
  32.         $this->intitule $intitule;
  33.         return $this;
  34.     }
  35.     public function getAlt(): ?string
  36.     {
  37.         return $this->alt;
  38.     }
  39.     public function setAlt(?string $alt): self
  40.     {
  41.         $this->alt $alt;
  42.         return $this;
  43.     }
  44.     public function getPhoto(): ?Upload
  45.     {
  46.         return $this->photo;
  47.     }
  48.     public function setPhoto(?Upload $photo): self
  49.     {
  50.         $this->photo $photo;
  51.         return $this;
  52.     }
  53.     public function getSousThemeThemes(): Collection
  54.     {
  55.         return $this->sousThemeThemes;
  56.     }
  57.     public function addSousThemeTheme(SousThemeTheme $sousThemeTheme): self
  58.     {
  59.         if (!$this->sousThemeThemes->contains($sousThemeTheme)) {
  60.             $this->sousThemeThemes->add($sousThemeTheme);
  61.             $sousThemeTheme->setSousTheme($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeSousThemeTheme(SousThemeTheme $sousThemeTheme): self
  66.     {
  67.         // set the owning side to null (unless already changed)
  68.         if ($this->sousThemeThemes->removeElement($sousThemeTheme) && $sousThemeTheme->getSousTheme() === $this) {
  69.             $sousThemeTheme->setSousTheme(null);
  70.         }
  71.         return $this;
  72.     }
  73.    
  74. }