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

Open in your IDE?
  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. /**
  11.  * @ORM\Entity(repositoryClass=SousThemeRepository::class)
  12.  */
  13. class SousTheme extends AbstractEntity
  14. {
  15.     /**
  16.      * @ORM\Column(type="string", length=255, nullable=false)
  17.      */
  18.     private string $intitule;
  19.     /**
  20.      * @ORM\OneToOne(targetEntity=Upload::class, cascade={"persist", "remove"})
  21.      * @ORM\JoinColumn(nullable=true)
  22.      */
  23.     private ?Upload $photo null;
  24.     /**
  25.      * @ORM\Column(type="string", length=255,nullable=true)
  26.      */
  27.     private ?string $alt null;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity=SousThemeTheme::class, mappedBy="sousTheme")
  30.      */
  31.     private Collection $sousThemeThemes;
  32.     public function __construct()
  33.     {
  34.         $this->sousThemeThemes = new ArrayCollection();
  35.     }
  36.     public function getIntitule(): ?string
  37.     {
  38.         return $this->intitule;
  39.     }
  40.     public function setIntitule(string $intitule): self
  41.     {
  42.         $this->intitule $intitule;
  43.         return $this;
  44.     }
  45.     public function getAlt(): ?string
  46.     {
  47.         return $this->alt;
  48.     }
  49.     public function setAlt(?string $alt): self
  50.     {
  51.         $this->alt $alt;
  52.         return $this;
  53.     }
  54.     public function getPhoto(): ?Upload
  55.     {
  56.         return $this->photo;
  57.     }
  58.     public function setPhoto(?Upload $photo): self
  59.     {
  60.         $this->photo $photo;
  61.         return $this;
  62.     }
  63.     public function getSousThemeThemes(): Collection
  64.     {
  65.         return $this->sousThemeThemes;
  66.     }
  67.     public function addSousThemeTheme(SousThemeTheme $sousThemeTheme): self
  68.     {
  69.         if (!$this->sousThemeThemes->contains($sousThemeTheme)) {
  70.             $this->sousThemeThemes->add($sousThemeTheme);
  71.             $sousThemeTheme->setSousTheme($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeSousThemeTheme(SousThemeTheme $sousThemeTheme): self
  76.     {
  77.         if ($this->sousThemeThemes->removeElement($sousThemeTheme)) {
  78.             // set the owning side to null (unless already changed)
  79.             if ($sousThemeTheme->getSousTheme() === $this) {
  80.                 $sousThemeTheme->setSousTheme(null);
  81.             }
  82.         }
  83.         return $this;
  84.     }
  85.    
  86. }