src/Entity/Sessionsformation.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Vich\UploadableField;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use App\Repository\SessionsformationRepository;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. #[ORM\Entity(repositoryClassSessionsformationRepository::class)]
  13. class Sessionsformation
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column,Assert\Positive]
  20.     private ?int $numsession null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $titre null;
  23.     #[ORM\Column(typeTypes::DATE_MUTABLE),
  24.         Assert\LessThan(propertyPath:'date_fin'message:"Cette valeur doit être inférieure à date fin"),
  25.         Assert\NotBlank()]
  26.     private ?\DateTimeInterface $date_debut null;
  27.     #[ORM\Column(typeTypes::DATE_MUTABLE),
  28.         Assert\GreaterThan(propertyPath:'date_debut'message:"Cette valeur doit être supérieure à date début")
  29.     ]
  30.     private ?\DateTimeInterface $date_fin null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $formateur null;
  33.     #[ORM\Column(length255)]
  34.     private ?string $adresse null;
  35.     #[ORM\Column(length255)]
  36.     private ?string $photo null;
  37.     #[ORM\Column(length255)]
  38.     private ?string $documentProg null;
  39.     #[UploadableField(mapping:'post_thumbnails'fileNameProperty:'photo')]
  40.     private $imageFile;
  41.     #[UploadableField(mapping:'post_thumbnails'fileNameProperty:'documentProg')]
  42.     private $DocFile;
  43.     #[ORM\Column(typeTypes::TEXTnullable:true)]
  44.     private ?string $description null;
  45.     #[ORM\OneToMany(mappedBy'sessionFormation'targetEntityInscriptionSessionFormation::class, cascade: ['persist''remove'])]
  46.     private Collection $inscriptionSessionFormations;
  47.     public function __construct()
  48.     {
  49.         $this->inscriptionSessionFormations = new ArrayCollection();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getNumsession(): ?int
  56.     {
  57.         return $this->numsession;
  58.     }
  59.     public function setNumsession(int $numsession): self
  60.     {
  61.         $this->numsession $numsession;
  62.         return $this;
  63.     }
  64.     public function getTitre(): ?string
  65.     {
  66.         return $this->titre;
  67.     }
  68.     public function setTitre(string $titre): self
  69.     {
  70.         $this->titre $titre;
  71.         return $this;
  72.     }
  73.     public function getDateDebut(): ?\DateTimeInterface
  74.     {
  75.         return $this->date_debut;
  76.     }
  77.     public function setDateDebut(\DateTimeInterface $date_debut): self
  78.     {
  79.         $this->date_debut $date_debut;
  80.         return $this;
  81.     }
  82.     public function getDateFin(): ?\DateTimeInterface
  83.     {
  84.         return $this->date_fin;
  85.     }
  86.     public function setDateFin(\DateTimeInterface $date_fin): self
  87.     {
  88.         $this->date_fin $date_fin;
  89.         return $this;
  90.     }
  91.     public function getFormateur(): ?string
  92.     {
  93.         return $this->formateur;
  94.     }
  95.     public function setFormateur(string $formateur): self
  96.     {
  97.         $this->formateur $formateur;
  98.         return $this;
  99.     }
  100.     public function getAdresse(): ?string
  101.     {
  102.         return $this->adresse;
  103.     }
  104.     public function setAdresse(string $adresse): self
  105.     {
  106.         $this->adresse $adresse;
  107.         return $this;
  108.     }
  109.     public function getPhoto(): ?string
  110.     {
  111.         return $this->photo;
  112.     }
  113.     public function setPhoto(string $photo): self
  114.     {
  115.         $this->photo $photo;
  116.         return $this;
  117.     }
  118.     public function getDocumentProg(): ?string
  119.     {
  120.         return $this->documentProg;
  121.     }
  122.     public function setDocumentProg(string $documentProg): self
  123.     {
  124.         $this->documentProg $documentProg;
  125.         return $this;
  126.     }
  127.     public function getDescription(): ?string
  128.     {
  129.         return $this->description;
  130.     }
  131.     public function setDescription(string $description): self
  132.     {
  133.         $this->description $description;
  134.         return $this;
  135.     }
  136.     public function setDocFile(File $image null)
  137.     {
  138.         $this->DocFile $image;
  139.         // VERY IMPORTANT:
  140.         // It is required that at least one field changes if you are using Doctrine,
  141.         // otherwise the event listeners won't be called and the file is lost
  142.         //  if ($image) {
  143.         // if 'updatedAt' is not defined in your entity, use another property
  144.         // $this->updatedAt = new \DateTime('now');
  145.         // }
  146.     }
  147.     public function getDocFile()
  148.     {
  149.         return $this->DocFile;
  150.     }
  151.     public function setImageFile(File $image null)
  152.     {
  153.         $this->imageFile $image;
  154.         // VERY IMPORTANT:
  155.         // It is required that at least one field changes if you are using Doctrine,
  156.         // otherwise the event listeners won't be called and the file is lost
  157.         //  if ($image) {
  158.         // if 'updatedAt' is not defined in your entity, use another property
  159.         // $this->updatedAt = new \DateTime('now');
  160.         // }
  161.     }
  162.     public function getImageFile()
  163.     {
  164.         return $this->imageFile;
  165.     }
  166.     /**
  167.      * @return Collection<int, InscriptionSessionFormation>
  168.      */
  169.     public function getInscriptionSessionFormations(): Collection
  170.     {
  171.         return $this->inscriptionSessionFormations;
  172.     }
  173.     public function addInscriptionSessionFormation(InscriptionSessionFormation $inscriptionSessionFormation): self
  174.     {
  175.         if (!$this->inscriptionSessionFormations->contains($inscriptionSessionFormation)) {
  176.             $this->inscriptionSessionFormations->add($inscriptionSessionFormation);
  177.             $inscriptionSessionFormation->setSessionFormation($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeInscriptionSessionFormation(InscriptionSessionFormation $inscriptionSessionFormation): self
  182.     {
  183.         if ($this->inscriptionSessionFormations->removeElement($inscriptionSessionFormation)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($inscriptionSessionFormation->getSessionFormation() === $this) {
  186.                 $inscriptionSessionFormation->setSessionFormation(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191. }