<?phpnamespace App\Entity\Cvs;use App\Entity\Core\Users;use App\Entity\Core\Agencies;use Doctrine\DBAL\Types\Types;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;use Doctrine\ORM\Mapping as ORM;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\HttpFoundation\File\UploadedFile;use Vich\UploaderBundle\Entity\File as EmbeddedFile;use Vich\UploaderBundle\Templating\Helper\UploaderHelper;/** * Jobs - Offre d'emploi. * * @ORM\Table("cvs_jobs") * @ORM\Entity(repositoryClass="App\Repository\Cvs\JobsRepository") * @ORM\HasLifecycleCallbacks() * @Vich\Uploadable */class Jobs{ /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @var string * * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"}) */ private $createdAt; /** * @var string * * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"}) */ private $updatedAt; /** * @var string * * @ORM\Column(name="jobtitle", type="string", length=255, nullable=true) */ private $jobTitle; /** * @var string * * @ORM\Column(name="category", type="string", length=255, nullable=true) */ private $category; /** * @var string * * @ORM\Column(name="employment_type", type="string", length=255, nullable=true) */ private $employmentType; /** * @var string * * @ORM\Column(name="experience_level", type="string", length=255, nullable=true) */ private $experienceLevel; /** * @var string * * @ORM\Column(name="remote_work", type="string", length=255, nullable=true) */ private $remoteWork; /** * @var string * * @ORM\Column(name="company_name", type="string", length=255, nullable=true) */ private $companyName; /** * @var string * * @ORM\Column(name="company_size", type="string", length=255, nullable=true) */ private $companySize; /** * @var string * * @ORM\Column(name="address", type="string", length=255, nullable=true) */ private $address; /** * @var string * * @ORM\Column(name="city", type="string", length=255, nullable=true) */ private $city; /** * @var string * * @ORM\Column(name="zipcode", type="string", length=255, nullable=true) */ private $zipcode; /** * @var string * * @ORM\Column(name="country", type="string", length=255, nullable=true) */ private $country; /** * @var string * * @ORM\Column(name="website", type="string", length=255, nullable=true) */ private $website; /** * @var string * * @ORM\Column(name="email", type="string", length=255, nullable=true) */ private $email; /** * @var string * * @ORM\Column(name="phone", type="string", length=255, nullable=true) */ private $phone; /** * @var string * * @ORM\Column(name="company_description", type="text", nullable=true) */ private $companyDescription; /** * @var string * * @ORM\Column(name="required_skills", type="text", nullable=true) */ private $requiredSkills; /** * @var string * * @ORM\Column(name="nice_to_have_skills", type="text", nullable=true) */ private $niceToHaveSkills; /** * @var string * * @ORM\Column(name="job_summary", type="text", nullable=true) */ private $jobSummary; /** * @var string * * @ORM\Column(name="key_responsabilities", type="text", nullable=true) */ private $keyResponsabilities; /** * @var string * * @ORM\Column(name="requirements", type="text", nullable=true) */ private $requirements; /** * @var string * * @ORM\Column(name="salary_min", type="integer", length=11, nullable=true) */ private $salaryMin; /** * @var string * * @ORM\Column(name="salary_max", type="integer", length=11, nullable=true) */ private $salaryMax; /** * @var string * * @ORM\Column(name="devise", type="string", length=255, nullable=true) */ private $devise; /** * @var string * * @ORM\Column(name="salary_period", type="string", length=255, nullable=true) */ private $salaryPeriod; /** * @var string * * @ORM\Column(name="benefits", type="text", nullable=true) */ private $benefits; /** * @var string * * @ORM\Column(name="contact_name", type="string", length=255, nullable=true) */ private $contactName; /** * @var string * * @ORM\Column(name="contact_email", type="string", length=255, nullable=true) */ private $contactEmail; /** * @var string * * @ORM\Column(name="contact_url", type="string", length=255, nullable=true) */ private $contactURL; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="cv_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions") * * @var File|null */ private $imageFile; /** * @ORM\Embedded(class="Vich\UploaderBundle\Entity\File") * * @var EmbeddedFile */ private $image; /** * @var string * * @ORM\Column(name="online", type="boolean", nullable=true) */ private $online; /** * @var \Users * * @ORM\ManyToOne(targetEntity="App\Entity\Core\Users") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true) * }) */ protected $user; /** * @var string * * @ORM\Column(name="slug", type="string", length=255, nullable=true) */ private $slug; /** * @var string * * @ORM\Column(name="locale", type="string", length=255, nullable=true) */ private $locale; /** * @var \Enterprises * * @ORM\ManyToOne(targetEntity="App\Entity\Cvs\Enterprises") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="enterprise_id", referencedColumnName="id", nullable=true) * }) */ protected $enterprise; public function __construct() { $this->image = new \Vich\UploaderBundle\Entity\File(); } /** * @ORM\PrePersist */ public function setCreatedAtValue(): void { $this->setCreatedAt(new \DateTime("now")); $this->setUpdatedAt(new \DateTime("now")); } /** * @ORM\PreUpdate */ public function setUpdatedAtValue(): void { $this->setUpdatedAt(new \DateTime("now")); } public function __toString() { return (string)$this->id; } /** * 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|UploadedFile|null $imageFile */ public function setImageFile(?File $imageFile = null) { $this->imageFile = $imageFile; if (null !== $imageFile) { // It is required that at least one field changes if you are using doctrine // otherwise the event listeners won't be called and the file is lost $this->setUpdatedAt(new \DateTime("now")); } } public function getImageFile(): ?File { return $this->imageFile; } public function setImage(EmbeddedFile $image): void { $this->image = $image; } public function getImage(): ?EmbeddedFile { return $this->image; } public function getImageBase64(?string $projectDir = null): ?string { if (!$this->image || !$this->image->getName()) { return null; } if (!$projectDir) { return null; // ou throw new \Exception('Project dir required'); } $filePath = $projectDir . '/files/cvs/' . $this->image->getName(); if (!file_exists($filePath)) { return null; } $imageData = file_get_contents($filePath); $mimeType = $this->image->getMimeType() ?? mime_content_type($filePath); return 'data:' . $mimeType . ';base64,' . base64_encode($imageData); } public function getId(): ?int { return $this->id; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(?\DateTimeInterface $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function getJobTitle(): ?string { return $this->jobTitle; } public function setJobTitle(?string $jobTitle): static { $this->jobTitle = $jobTitle; return $this; } public function getCategory(): ?string { return $this->category; } public function setCategory(?string $category): static { $this->category = $category; return $this; } public function getEmploymentType(): ?string { return $this->employmentType; } public function setEmploymentType(?string $employmentType): static { $this->employmentType = $employmentType; return $this; } public function getExperienceLevel(): ?string { return $this->experienceLevel; } public function setExperienceLevel(?string $experienceLevel): static { $this->experienceLevel = $experienceLevel; return $this; } public function getRemoteWork(): ?string { return $this->remoteWork; } public function setRemoteWork(?string $remoteWork): static { $this->remoteWork = $remoteWork; return $this; } public function getCompanyName(): ?string { return $this->companyName; } public function setCompanyName(?string $companyName): static { $this->companyName = $companyName; return $this; } public function getAddress(): ?string { return $this->address; } public function setAddress(?string $address): static { $this->address = $address; return $this; } public function getCity(): ?string { return $this->city; } public function setCity(?string $city): static { $this->city = $city; return $this; } public function getZipcode(): ?string { return $this->zipcode; } public function setZipcode(?string $zipcode): static { $this->zipcode = $zipcode; return $this; } public function getCountry(): ?string { return $this->country; } public function setCountry(?string $country): static { $this->country = $country; return $this; } public function getWebsite(): ?string { return $this->website; } public function setWebsite(?string $website): static { $this->website = $website; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): static { $this->email = $email; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(?string $phone): static { $this->phone = $phone; return $this; } public function getCompanyDescription(): ?string { return $this->companyDescription; } public function setCompanyDescription(?string $companyDescription): static { $this->companyDescription = $companyDescription; return $this; } public function getRequiredSkills(): ?string { return $this->requiredSkills; } public function setRequiredSkills(?string $requiredSkills): static { $this->requiredSkills = $requiredSkills; return $this; } public function getNiceToHaveSkills(): ?string { return $this->niceToHaveSkills; } public function setNiceToHaveSkills(?string $niceToHaveSkills): static { $this->niceToHaveSkills = $niceToHaveSkills; return $this; } public function getJobSummary(): ?string { return $this->jobSummary; } public function setJobSummary(?string $jobSummary): static { $this->jobSummary = $jobSummary; return $this; } public function getKeyResponsabilities(): ?string { return $this->keyResponsabilities; } public function setKeyResponsabilities(?string $keyResponsabilities): static { $this->keyResponsabilities = $keyResponsabilities; return $this; } public function getRequirements(): ?string { return $this->requirements; } public function setRequirements(?string $requirements): static { $this->requirements = $requirements; return $this; } public function getSalaryMin(): ?int { return $this->salaryMin; } public function setSalaryMin(?int $salaryMin): static { $this->salaryMin = $salaryMin; return $this; } public function getSalaryMax(): ?int { return $this->salaryMax; } public function setSalaryMax(?int $salaryMax): static { $this->salaryMax = $salaryMax; return $this; } public function getDevise(): ?string { return $this->devise; } public function setDevise(?string $devise): static { $this->devise = $devise; return $this; } public function getSalaryPeriod(): ?string { return $this->salaryPeriod; } public function setSalaryPeriod(?string $salaryPeriod): static { $this->salaryPeriod = $salaryPeriod; return $this; } public function getBenefits(): ?string { return $this->benefits; } public function setBenefits(?string $benefits): static { $this->benefits = $benefits; return $this; } public function getContactName(): ?string { return $this->contactName; } public function setContactName(?string $contactName): static { $this->contactName = $contactName; return $this; } public function getContactEmail(): ?string { return $this->contactEmail; } public function setContactEmail(?string $contactEmail): static { $this->contactEmail = $contactEmail; return $this; } public function getContactURL(): ?string { return $this->contactURL; } public function setContactURL(?string $contactURL): static { $this->contactURL = $contactURL; return $this; } public function isOnline(): ?bool { return $this->online; } public function setOnline(?bool $online): static { $this->online = $online; return $this; } public function getUser(): ?Users { return $this->user; } public function setUser(?Users $user): static { $this->user = $user; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(?string $slug): static { $this->slug = $slug; return $this; } public function getLocale(): ?string { return $this->locale; } public function setLocale(?string $locale): static { $this->locale = $locale; return $this; } public function getEnterprise(): ?Enterprises { return $this->enterprise; } public function setEnterprise(?Enterprises $enterprise): static { $this->enterprise = $enterprise; return $this; } public function getCompanySize(): ?string { return $this->companySize; } public function setCompanySize(?string $companySize): static { $this->companySize = $companySize; return $this; }}