src/Entity/Course.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CourseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Symfony\Component\HttpFoundation\File\UploadedFile;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @ORM\Entity(repositoryClass=CourseRepository::class)
  12.  * @Vich\Uploadable
  13.  */
  14. class Course
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(name="idCourse",type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=45, nullable=true)
  24.      */
  25.     private $reference;
  26.     /**
  27.      * @ORM\Column(type="string", length=127, nullable=true)
  28.      */
  29.     private $title;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $descriptionShort;
  34.     /**
  35.      * @ORM\Column(type="text", nullable=true)
  36.      */
  37.     private $description;
  38.     /**
  39.      * @ORM\Column(type="boolean", nullable=true)
  40.      */
  41.     private $onSale;
  42.     /**
  43.      * @ORM\Column(type="integer", nullable=true)
  44.      */
  45.     private $remote;
  46.     /**
  47.      * @ORM\Column(type="integer", nullable=true)
  48.      */
  49.     private $onSite;
  50.     /**
  51.      * @ORM\Column(type="string", length=127, nullable=true)
  52.      */
  53.     private $address1Default;
  54.     /**
  55.      * @ORM\Column(type="string", length=127, nullable=true)
  56.      */
  57.     private $address2Default;
  58.     /**
  59.      * @ORM\Column(type="string", length=127, nullable=true)
  60.      */
  61.     private $address3Default;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $postCodeDefault;
  66.     /**
  67.      * @ORM\Column(type="string", length=45, nullable=true)
  68.      */
  69.     private $cityDefault;
  70.     /**
  71.      * @ORM\Column(type="string", length=45, nullable=true)
  72.      */
  73.     private $countryDefault;
  74.     /**
  75.      * @ORM\Column(type="string", length=45, nullable=true)
  76.      */
  77.     private $contact;
  78.     /**
  79.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  80.      * 
  81.      * @Vich\UploadableField(mapping="images", fileNameProperty="image")
  82.      * 
  83.      * @var File|null
  84.      */
  85.     private $imageFile;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      * @var string|null
  89.      */
  90.     private $image;
  91.     /**
  92.      * @ORM\Column(type="integer", nullable=true)
  93.      */
  94.     private $categorieId;
  95.     /**
  96.      * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="courses")
  97.      * @ORM\JoinColumn(name="categorie_id", nullable=false, referencedColumnName="idCategory")
  98.      */
  99.     private $category;
  100.     /**
  101.      * @ORM\Column(type="text", nullable=true)
  102.      */
  103.     private $skillsDescription;
  104.     /**
  105.      * @ORM\Column(type="text", nullable=true)
  106.      */
  107.     private $organizationDescription;
  108.     /**
  109.      * @ORM\Column(type="text", nullable=true)
  110.      */
  111.     private $learningObjectives;
  112.     /**
  113.      * @ORM\Column(type="text", nullable=true)
  114.      */
  115.     private $content;
  116.     /**
  117.      * @ORM\ManyToOne(targetEntity=Certificate::class, inversedBy="courses")
  118.      * @ORM\JoinColumn(nullable=true)
  119.      */
  120.     private $certificate;
  121.     /**
  122.      * @ORM\Column(type="boolean", nullable=true)
  123.      */
  124.     private $isActive;
  125.     /**
  126.      * @ORM\ManyToOne(targetEntity=Competence::class, inversedBy="course")
  127.      */
  128.     private $competence;
  129.     /**
  130.      * @ORM\Column(type="integer")
  131.      */
  132.     private $yearOfExp;
  133.     public function getId(): ?int
  134.     {
  135.         return $this->id;
  136.     }
  137.     public function getReference(): ?string
  138.     {
  139.         return $this->reference;
  140.     }
  141.     public function setReference(?string $reference): self
  142.     {
  143.         $this->reference $reference;
  144.         return $this;
  145.     }
  146.     public function getTitle(): ?string
  147.     {
  148.         return $this->title;
  149.     }
  150.     public function setTitle(?string $title): self
  151.     {
  152.         $this->title $title;
  153.         return $this;
  154.     }
  155.     public function getDescriptionShort(): ?string
  156.     {
  157.         return $this->descriptionShort;
  158.     }
  159.     public function setDescriptionShort(?string $descriptionShort): self
  160.     {
  161.         $this->descriptionShort $descriptionShort;
  162.         return $this;
  163.     }
  164.     public function getDescription(): ?string
  165.     {
  166.         return $this->description;
  167.     }
  168.     public function setDescription(?string $description): self
  169.     {
  170.         $this->description $description;
  171.         return $this;
  172.     }
  173.     public function getOnSale(): ?bool
  174.     {
  175.         return $this->onSale;
  176.     }
  177.     public function setOnSale(?bool $onSale): self
  178.     {
  179.         $this->onSale $onSale;
  180.         return $this;
  181.     }
  182.     public function getRemote(): ?int
  183.     {
  184.         return $this->remote;
  185.     }
  186.     public function setRemote(?int $remote): self
  187.     {
  188.         $this->remote $remote;
  189.         return $this;
  190.     }
  191.     public function getOnSite(): ?int
  192.     {
  193.         return $this->onSite;
  194.     }
  195.     public function setOnSite(?int $onSite): self
  196.     {
  197.         $this->onSite $onSite;
  198.         return $this;
  199.     }
  200.     public function getAddress1Default(): ?string
  201.     {
  202.         return $this->address1Default;
  203.     }
  204.     public function setAddress1Default(?string $address1Default): self
  205.     {
  206.         $this->address1Default $address1Default;
  207.         return $this;
  208.     }
  209.     public function getAddress2Default(): ?string
  210.     {
  211.         return $this->address2Default;
  212.     }
  213.     public function setAddress2Default(?string $address2Default): self
  214.     {
  215.         $this->address2Default $address2Default;
  216.         return $this;
  217.     }
  218.     public function getAddress3Default(): ?string
  219.     {
  220.         return $this->address3Default;
  221.     }
  222.     public function setAddress3Default(?string $address3Default): self
  223.     {
  224.         $this->address3Default $address3Default;
  225.         return $this;
  226.     }
  227.     public function getPostCodeDefault(): ?string
  228.     {
  229.         return $this->postCodeDefault;
  230.     }
  231.     public function setPostCodeDefault(?string $postCodeDefault): self
  232.     {
  233.         $this->postCodeDefault $postCodeDefault;
  234.         return $this;
  235.     }
  236.     public function getCityDefault(): ?string
  237.     {
  238.         return $this->cityDefault;
  239.     }
  240.     public function setCityDefault(?string $cityDefault): self
  241.     {
  242.         $this->cityDefault $cityDefault;
  243.         return $this;
  244.     }
  245.     public function getCountryDefault(): ?string
  246.     {
  247.         return $this->countryDefault;
  248.     }
  249.     public function setCountryDefault(?string $countryDefault): self
  250.     {
  251.         $this->countryDefault $countryDefault;
  252.         return $this;
  253.     }
  254.     public function getContact(): ?string
  255.     {
  256.         return $this->contact;
  257.     }
  258.     public function setContact(?string $contact): self
  259.     {
  260.         $this->contact $contact;
  261.         return $this;
  262.     }
  263.     /**
  264.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  265.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  266.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  267.      * must be able to accept an instance of 'File' as the bundle will inject one here
  268.      * during Doctrine hydration.
  269.      *
  270.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $pictureFile
  271.      */
  272.     public function setImageFile(?File $imageFile null)
  273.     {
  274.         $this->imageFile $imageFile;
  275.         if ($imageFile instanceof UploadedFile) {
  276.             $this->setImage($imageFile->getClientOriginalName());
  277.             $this->updatedAt = new \DateTime();
  278.         }
  279.     
  280.         return $this;
  281.     }
  282.     public function getImageFile(): ?File
  283.     {
  284.         return $this->imageFile;
  285.     }
  286.     public function getImage(): ?string
  287.     {
  288.         return $this->image;
  289.     }
  290.     public function setImage(?string $image): self
  291.     {
  292.         $this->image $image;
  293.         return $this;
  294.     }
  295.     public function getCategorieId(): ?int
  296.     {
  297.         return $this->categorieId;
  298.     }
  299.     public function setCategorieId(?int $categorieId): self
  300.     {
  301.         $this->categorieId $categorieId;
  302.         return $this;
  303.     }
  304.     /**
  305.      * Get the value of category
  306.      */ 
  307.     public function getCategory()
  308.     {
  309.         return $this->category;
  310.     }
  311.     /**
  312.      * Set the value of category
  313.      *
  314.      * @return  self
  315.      */ 
  316.     public function setCategory($category)
  317.     {
  318.         $this->category $category;
  319.         return $this;
  320.     }
  321.     public function getSkillsDescription(): ?string
  322.     {
  323.         return $this->skillsDescription;
  324.     }
  325.     public function setSkillsDescription(?string $skillsDescription): self
  326.     {
  327.         $this->skillsDescription $skillsDescription;
  328.         return $this;
  329.     }
  330.     public function getOrganizationDescription(): ?string
  331.     {
  332.         return $this->organizationDescription;
  333.     }
  334.     public function setOrganizationDescription(?string $organizationDescription): self
  335.     {
  336.         $this->organizationDescription $organizationDescription;
  337.         return $this;
  338.     }
  339.     public function getLearningObjectives(): ?string
  340.     {
  341.         return $this->learningObjectives;
  342.     }
  343.     public function setLearningObjectives(?string $learningObjectives): self
  344.     {
  345.         $this->learningObjectives $learningObjectives;
  346.         return $this;
  347.     }
  348.     public function getContent(): ?string
  349.     {
  350.         return $this->content;
  351.     }
  352.     public function setContent(?string $content): self
  353.     {
  354.         $this->content $content;
  355.         return $this;
  356.     }
  357.     public function getCertificate(): ?Certificate
  358.     {
  359.         return $this->certificate;
  360.     }
  361.     public function setCertificate(?Certificate $certificate): self
  362.     {
  363.         $this->certificate $certificate;
  364.         return $this;
  365.     }
  366.     public function getIsActive(): ?bool
  367.     {
  368.         return $this->isActive;
  369.     }
  370.     public function setIsActive(?bool $isActive): self
  371.     {
  372.         $this->isActive $isActive;
  373.         return $this;
  374.     }
  375.     public function getCompetence(): ?Competence
  376.     {
  377.         return $this->competence;
  378.     }
  379.     public function setCompetence(?Competence $competence): self
  380.     {
  381.         $this->competence $competence;
  382.         return $this;
  383.     }
  384.     public function getYearOfExp(): ?int
  385.     {
  386.         return $this->yearOfExp;
  387.     }
  388.     public function setYearOfExp(int $yearOfExp): self
  389.     {
  390.         $this->yearOfExp $yearOfExp;
  391.         return $this;
  392.     }
  393. }