<?php
namespace App\Entity;
use App\Repository\CourseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=CourseRepository::class)
* @Vich\Uploadable
*/
class Course
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(name="idCourse",type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=45, nullable=true)
*/
private $reference;
/**
* @ORM\Column(type="string", length=127, nullable=true)
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $descriptionShort;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $onSale;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $remote;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $onSite;
/**
* @ORM\Column(type="string", length=127, nullable=true)
*/
private $address1Default;
/**
* @ORM\Column(type="string", length=127, nullable=true)
*/
private $address2Default;
/**
* @ORM\Column(type="string", length=127, nullable=true)
*/
private $address3Default;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $postCodeDefault;
/**
* @ORM\Column(type="string", length=45, nullable=true)
*/
private $cityDefault;
/**
* @ORM\Column(type="string", length=45, nullable=true)
*/
private $countryDefault;
/**
* @ORM\Column(type="string", length=45, nullable=true)
*/
private $contact;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Vich\UploadableField(mapping="images", fileNameProperty="image")
*
* @var File|null
*/
private $imageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @var string|null
*/
private $image;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $categorieId;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="courses")
* @ORM\JoinColumn(name="categorie_id", nullable=false, referencedColumnName="idCategory")
*/
private $category;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $skillsDescription;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $organizationDescription;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $learningObjectives;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $content;
/**
* @ORM\ManyToOne(targetEntity=Certificate::class, inversedBy="courses")
* @ORM\JoinColumn(nullable=true)
*/
private $certificate;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @ORM\ManyToOne(targetEntity=Competence::class, inversedBy="course")
*/
private $competence;
/**
* @ORM\Column(type="integer")
*/
private $yearOfExp;
public function getId(): ?int
{
return $this->id;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getDescriptionShort(): ?string
{
return $this->descriptionShort;
}
public function setDescriptionShort(?string $descriptionShort): self
{
$this->descriptionShort = $descriptionShort;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getOnSale(): ?bool
{
return $this->onSale;
}
public function setOnSale(?bool $onSale): self
{
$this->onSale = $onSale;
return $this;
}
public function getRemote(): ?int
{
return $this->remote;
}
public function setRemote(?int $remote): self
{
$this->remote = $remote;
return $this;
}
public function getOnSite(): ?int
{
return $this->onSite;
}
public function setOnSite(?int $onSite): self
{
$this->onSite = $onSite;
return $this;
}
public function getAddress1Default(): ?string
{
return $this->address1Default;
}
public function setAddress1Default(?string $address1Default): self
{
$this->address1Default = $address1Default;
return $this;
}
public function getAddress2Default(): ?string
{
return $this->address2Default;
}
public function setAddress2Default(?string $address2Default): self
{
$this->address2Default = $address2Default;
return $this;
}
public function getAddress3Default(): ?string
{
return $this->address3Default;
}
public function setAddress3Default(?string $address3Default): self
{
$this->address3Default = $address3Default;
return $this;
}
public function getPostCodeDefault(): ?string
{
return $this->postCodeDefault;
}
public function setPostCodeDefault(?string $postCodeDefault): self
{
$this->postCodeDefault = $postCodeDefault;
return $this;
}
public function getCityDefault(): ?string
{
return $this->cityDefault;
}
public function setCityDefault(?string $cityDefault): self
{
$this->cityDefault = $cityDefault;
return $this;
}
public function getCountryDefault(): ?string
{
return $this->countryDefault;
}
public function setCountryDefault(?string $countryDefault): self
{
$this->countryDefault = $countryDefault;
return $this;
}
public function getContact(): ?string
{
return $this->contact;
}
public function setContact(?string $contact): self
{
$this->contact = $contact;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $pictureFile
*/
public function setImageFile(?File $imageFile = null)
{
$this->imageFile = $imageFile;
if ($imageFile instanceof UploadedFile) {
$this->setImage($imageFile->getClientOriginalName());
$this->updatedAt = new \DateTime();
}
return $this;
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getCategorieId(): ?int
{
return $this->categorieId;
}
public function setCategorieId(?int $categorieId): self
{
$this->categorieId = $categorieId;
return $this;
}
/**
* Get the value of category
*/
public function getCategory()
{
return $this->category;
}
/**
* Set the value of category
*
* @return self
*/
public function setCategory($category)
{
$this->category = $category;
return $this;
}
public function getSkillsDescription(): ?string
{
return $this->skillsDescription;
}
public function setSkillsDescription(?string $skillsDescription): self
{
$this->skillsDescription = $skillsDescription;
return $this;
}
public function getOrganizationDescription(): ?string
{
return $this->organizationDescription;
}
public function setOrganizationDescription(?string $organizationDescription): self
{
$this->organizationDescription = $organizationDescription;
return $this;
}
public function getLearningObjectives(): ?string
{
return $this->learningObjectives;
}
public function setLearningObjectives(?string $learningObjectives): self
{
$this->learningObjectives = $learningObjectives;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getCertificate(): ?Certificate
{
return $this->certificate;
}
public function setCertificate(?Certificate $certificate): self
{
$this->certificate = $certificate;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getCompetence(): ?Competence
{
return $this->competence;
}
public function setCompetence(?Competence $competence): self
{
$this->competence = $competence;
return $this;
}
public function getYearOfExp(): ?int
{
return $this->yearOfExp;
}
public function setYearOfExp(int $yearOfExp): self
{
$this->yearOfExp = $yearOfExp;
return $this;
}
}