src\Entity\ChapitreFormation.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass\App\Repository\ChapitreFormationRepository::class)]
  7. class ChapitreFormation
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255)]
  14.     private $titre;
  15.     #[ORM\Column(type'text'nullabletrue)]
  16.     private $contenu;
  17.     #[ORM\ManyToOne(targetEntity\App\Entity\User::class, inversedBy'chapitresFormation')]
  18.     private $user;
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     #[ORM\ManyToOne(targetEntity\App\Entity\Formation::class, inversedBy'chapitres')]
  21.     private $formation;
  22.     #[ORM\Column(type'datetime')]
  23.     private $created_at;
  24.     #[ORM\Column(type'datetime'nullabletrue)]
  25.     private $updated_at;
  26.     #[ORM\Column(type'boolean')]
  27.     private $status;
  28.     #[ORM\OneToMany(targetEntity\App\Entity\FichierFormation::class, mappedBy'chapitre'orphanRemovaltrue)]
  29.     private $fichiers;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $duree;
  32.     public function __construct()
  33.     {
  34.         $this->created_at=new \DateTime();
  35.         $this->status=false;
  36.         $this->fichiers = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getTitre(): ?string
  43.     {
  44.         return $this->titre;
  45.     }
  46.     public function setTitre(string $titre): self
  47.     {
  48.         $this->titre $titre;
  49.         return $this;
  50.     }
  51.     public function getContenu(): ?string
  52.     {
  53.         return $this->contenu;
  54.     }
  55.     public function setContenu(?string $contenu): self
  56.     {
  57.         $this->contenu $contenu;
  58.         return $this;
  59.     }
  60.     public function getUser(): ?User
  61.     {
  62.         return $this->user;
  63.     }
  64.     public function setUser(?User $user): self
  65.     {
  66.         $this->user $user;
  67.         return $this;
  68.     }
  69.     public function getFormation(): ?Formation
  70.     {
  71.         return $this->formation;
  72.     }
  73.     public function setFormation(?Formation $formation): self
  74.     {
  75.         $this->formation $formation;
  76.         return $this;
  77.     }
  78.     public function getCreatedAt(): ?\DateTimeInterface
  79.     {
  80.         return $this->created_at;
  81.     }
  82.     public function setCreatedAt(\DateTimeInterface $created_at): self
  83.     {
  84.         $this->created_at $created_at;
  85.         return $this;
  86.     }
  87.     public function getUpdatedAt(): ?\DateTimeInterface
  88.     {
  89.         return $this->updated_at;
  90.     }
  91.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  92.     {
  93.         $this->updated_at $updated_at;
  94.         return $this;
  95.     }
  96.     public function getStatus(): ?bool
  97.     {
  98.         return $this->status;
  99.     }
  100.     public function setStatus(bool $status): self
  101.     {
  102.         $this->status $status;
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return Collection|FichierFormation[]
  107.      */
  108.     public function getFichiers(): Collection
  109.     {
  110.         return $this->fichiers;
  111.     }
  112.     public function addFichier(FichierFormation $fichier): self
  113.     {
  114.         if (!$this->fichiers->contains($fichier)) {
  115.             $this->fichiers[] = $fichier;
  116.             $fichier->setChapitre($this);
  117.         }
  118.         return $this;
  119.     }
  120.     public function removeFichier(FichierFormation $fichier): self
  121.     {
  122.         if ($this->fichiers->contains($fichier)) {
  123.             $this->fichiers->removeElement($fichier);
  124.             // set the owning side to null (unless already changed)
  125.             if ($fichier->getChapitre() === $this) {
  126.                 $fichier->setChapitre(null);
  127.             }
  128.         }
  129.         return $this;
  130.     }
  131.     public function getDuree(): ?string
  132.     {
  133.         return $this->duree;
  134.     }
  135.     public function setDuree(?string $duree): self
  136.     {
  137.         $this->duree $duree;
  138.         return $this;
  139.     }
  140. }