src/Entity/Cvs/Jobs.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Cvs;
  3. use App\Entity\Core\Users;
  4. use App\Entity\Core\Agencies;
  5. use Doctrine\DBAL\Types\Types;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. use Symfony\Component\HttpFoundation\File\UploadedFile;
  12. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  13. use Vich\UploaderBundle\Templating\Helper\UploaderHelper;
  14. /**
  15.  * Jobs - Offre d'emploi.
  16.  *
  17.  * @ORM\Table("cvs_jobs")
  18.  * @ORM\Entity(repositoryClass="App\Repository\Cvs\JobsRepository")
  19.  * @ORM\HasLifecycleCallbacks()
  20.  * @Vich\Uploadable
  21.  */
  22. class Jobs
  23. {
  24.     /**
  25.      * @var integer
  26.      *
  27.      * @ORM\Column(name="id", type="integer")
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue(strategy="AUTO")
  30.      */
  31.     protected $id;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  42.      */
  43.     private $updatedAt;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="jobtitle", type="string", length=255, nullable=true)
  48.      */
  49.     private $jobTitle;
  50.     /**
  51.      * @var string
  52.      *
  53.      * @ORM\Column(name="category", type="string", length=255, nullable=true)
  54.      */
  55.     private $category;
  56.     /**
  57.      * @var string
  58.      *
  59.      * @ORM\Column(name="employment_type", type="string", length=255, nullable=true)
  60.      */
  61.     private $employmentType;
  62.     /**
  63.      * @var string
  64.      *
  65.      * @ORM\Column(name="experience_level", type="string", length=255, nullable=true)
  66.      */
  67.     private $experienceLevel;
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="remote_work", type="string", length=255, nullable=true)
  72.      */
  73.     private $remoteWork;
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="company_name", type="string", length=255, nullable=true)
  78.      */
  79.     private $companyName;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(name="company_size", type="string", length=255, nullable=true)
  84.      */
  85.     private $companySize;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(name="short_title", type="text", nullable=true)
  90.      */
  91.     private $shortTitle;
  92.     /**
  93.      * @var string
  94.      *
  95.      * @ORM\Column(name="short_description", type="text", nullable=true)
  96.      */
  97.     private $shortDescription;
  98.     /**
  99.      * @var string
  100.      *
  101.      * @ORM\Column(name="address", type="string", length=255, nullable=true)
  102.      */
  103.     private $address;
  104.     /**
  105.      * @var string
  106.      *
  107.      * @ORM\Column(name="city", type="string", length=255, nullable=true)
  108.      */
  109.     private $city;
  110.     /**
  111.      * @var string
  112.      *
  113.      * @ORM\Column(name="zipcode", type="string", length=255, nullable=true)
  114.      */
  115.     private $zipcode;
  116.     /**
  117.      * @var string
  118.      *
  119.      * @ORM\Column(name="country", type="string", length=255, nullable=true)
  120.      */
  121.     private $country;
  122.     /**
  123.      * @var string
  124.      *
  125.      * @ORM\Column(name="website", type="string", length=255, nullable=true)
  126.      */
  127.     private $website;
  128.     /**
  129.      * @var string
  130.      *
  131.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  132.      */
  133.     private $email;
  134.     /**
  135.      * @var string
  136.      *
  137.      * @ORM\Column(name="phone", type="string", length=255, nullable=true)
  138.      */
  139.     private $phone;
  140.     /**
  141.      * @var string
  142.      *
  143.      * @ORM\Column(name="company_description", type="text", nullable=true)
  144.      */
  145.     private $companyDescription;
  146.     /**
  147.      * @var string
  148.      *
  149.      * @ORM\Column(name="required_skills", type="text", nullable=true)
  150.      */
  151.     private $requiredSkills;
  152.     /**
  153.      * @var string
  154.      *
  155.      * @ORM\Column(name="nice_to_have_skills", type="text", nullable=true)
  156.      */
  157.     private $niceToHaveSkills;
  158.     /**
  159.      * @var string
  160.      *
  161.      * @ORM\Column(name="job_summary", type="text", nullable=true)
  162.      */
  163.     private $jobSummary;
  164.     /**
  165.      * @var string
  166.      *
  167.      * @ORM\Column(name="key_responsabilities", type="text", nullable=true)
  168.      */
  169.     private $keyResponsabilities;
  170.     /**
  171.      * @var string
  172.      *
  173.      * @ORM\Column(name="requirements", type="text", nullable=true)
  174.      */
  175.     private $requirements;
  176.     /**
  177.      * @var string
  178.      *
  179.      * @ORM\Column(name="salary_min", type="integer", length=11, nullable=true)
  180.      */
  181.     private $salaryMin;
  182.     /**
  183.      * @var string
  184.      *
  185.      * @ORM\Column(name="salary_max", type="integer", length=11, nullable=true)
  186.      */
  187.     private $salaryMax;
  188.     /**
  189.      * @var string
  190.      *
  191.      * @ORM\Column(name="devise", type="string", length=255, nullable=true)
  192.      */
  193.     private $devise;
  194.     /**
  195.      * @var string
  196.      *
  197.      * @ORM\Column(name="salary_period", type="string", length=255, nullable=true)
  198.      */
  199.     private $salaryPeriod;
  200.     /**
  201.      * @var string
  202.      *
  203.      * @ORM\Column(name="benefits", type="text", nullable=true)
  204.      */
  205.     private $benefits;
  206.     /**
  207.      * @var string
  208.      *
  209.      * @ORM\Column(name="contact_name", type="string", length=255, nullable=true)
  210.      */
  211.     private $contactName;
  212.     /**
  213.      * @var string
  214.      *
  215.      * @ORM\Column(name="contact_email", type="string", length=255, nullable=true)
  216.      */
  217.     private $contactEmail;
  218.     /**
  219.      * @var string
  220.      *
  221.      * @ORM\Column(name="contact_url", type="string", length=255, nullable=true)
  222.      */
  223.     private $contactURL;
  224.     /**
  225.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  226.      *
  227.      * @Vich\UploadableField(mapping="cv_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions")
  228.      *
  229.      * @var File|null
  230.      */
  231.     private $imageFile;
  232.     /**
  233.      * @ORM\Embedded(class="Vich\UploaderBundle\Entity\File")
  234.      *
  235.      * @var EmbeddedFile
  236.      */
  237.     private $image;
  238.     /**
  239.      * @var string
  240.      *
  241.      * @ORM\Column(name="online", type="boolean", nullable=true)
  242.      */
  243.     private $online;
  244.     /**
  245.      * @var \Users
  246.      *
  247.      * @ORM\ManyToOne(targetEntity="App\Entity\Core\Users")
  248.      * @ORM\JoinColumns({
  249.      *   @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
  250.      * })
  251.      */
  252.     protected $user;
  253.     /**
  254.      * @var string
  255.      *
  256.      * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  257.      */
  258.     private $slug;
  259.     /**
  260.      * @var string
  261.      *
  262.      * @ORM\Column(name="keywords", type="string", length=255, nullable=true)
  263.      */
  264.     private $keywords;
  265.     /**
  266.      * @var string
  267.      *
  268.      * @ORM\Column(name="locale", type="string", length=255, nullable=true)
  269.      */
  270.     private $locale;
  271.     /**
  272.      * @var string
  273.      *
  274.      * @ORM\Column(name="views", type="integer", length=11, nullable=true)
  275.      */
  276.     private $views;
  277.     /**
  278.      * @var string
  279.      *
  280.      * @ORM\Column(name="validation", type="boolean", nullable=true)
  281.      */
  282.     private $validation;
  283.     /**
  284.      * @var string
  285.      *
  286.      * @ORM\Column(name="verification", type="boolean", nullable=true)
  287.      */
  288.     private $verification;
  289.     /**
  290.      * @var \Enterprises
  291.      *
  292.      * @ORM\ManyToOne(targetEntity="App\Entity\Cvs\Enterprises")
  293.      * @ORM\JoinColumns({
  294.      *   @ORM\JoinColumn(name="enterprise_id", referencedColumnName="id", nullable=true)
  295.      * })
  296.      */
  297.     protected $enterprise;
  298.     /**
  299.      * @var string
  300.      *
  301.      * @ORM\Column(name="websearch", type="boolean", nullable=true)
  302.      */
  303.     private $websearch;
  304.     public function __construct()
  305.     {
  306.         $this->image = new \Vich\UploaderBundle\Entity\File();
  307.     }
  308.     /**
  309.      * @ORM\PrePersist
  310.      */
  311.     public function setCreatedAtValue(): void
  312.     {
  313.         $this->setCreatedAt(new \DateTime("now"));
  314.         $this->setUpdatedAt(new \DateTime("now"));
  315.     }
  316.     /**
  317.      * @ORM\PreUpdate
  318.      */
  319.     public function setUpdatedAtValue(): void
  320.     {
  321.         $this->setUpdatedAt(new \DateTime("now"));
  322.     }
  323.     public function __toString()
  324.     {
  325.         return (string)$this->id;
  326.     }
  327.     /**
  328.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  329.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  330.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  331.      * must be able to accept an instance of 'File' as the bundle will inject one here
  332.      * during Doctrine hydration.
  333.      *
  334.      * @param File|UploadedFile|null $imageFile
  335.      */
  336.     public function setImageFile(?File $imageFile null)
  337.     {
  338.         $this->imageFile $imageFile;
  339.         if (null !== $imageFile) {
  340.             // It is required that at least one field changes if you are using doctrine
  341.             // otherwise the event listeners won't be called and the file is lost
  342.             $this->setUpdatedAt(new \DateTime("now"));
  343.         }
  344.     }
  345.     public function getImageFile(): ?File
  346.     {
  347.         return $this->imageFile;
  348.     }
  349.     public function setImage(EmbeddedFile $image): void
  350.     {
  351.         $this->image $image;
  352.     }
  353.     public function getImage(): ?EmbeddedFile
  354.     {
  355.         return $this->image;
  356.     }
  357.     public function getImageBase64(?string $projectDir null): ?string
  358.     {
  359.         if (!$this->image || !$this->image->getName()) {
  360.             return null;
  361.         }
  362.         if (!$projectDir) {
  363.             return null// ou throw new \Exception('Project dir required');
  364.         }
  365.         $filePath $projectDir '/files/cvs/' $this->image->getName();
  366.         if (!file_exists($filePath)) {
  367.             return null;
  368.         }
  369.         $imageData file_get_contents($filePath);
  370.         $mimeType $this->image->getMimeType() ?? mime_content_type($filePath);
  371.         return 'data:' $mimeType ';base64,' base64_encode($imageData);
  372.     }
  373.     public function getId(): ?int
  374.     {
  375.         return $this->id;
  376.     }
  377.     public function getCreatedAt(): ?\DateTimeInterface
  378.     {
  379.         return $this->createdAt;
  380.     }
  381.     public function setCreatedAt(?\DateTimeInterface $createdAt): static
  382.     {
  383.         $this->createdAt $createdAt;
  384.         return $this;
  385.     }
  386.     public function getUpdatedAt(): ?\DateTimeInterface
  387.     {
  388.         return $this->updatedAt;
  389.     }
  390.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  391.     {
  392.         $this->updatedAt $updatedAt;
  393.         return $this;
  394.     }
  395.     public function getJobTitle(): ?string
  396.     {
  397.         return $this->jobTitle;
  398.     }
  399.     public function setJobTitle(?string $jobTitle): static
  400.     {
  401.         $this->jobTitle $jobTitle;
  402.         return $this;
  403.     }
  404.     public function getCategory(): ?string
  405.     {
  406.         return $this->category;
  407.     }
  408.     public function setCategory(?string $category): static
  409.     {
  410.         $this->category $category;
  411.         return $this;
  412.     }
  413.     public function getEmploymentType(): ?string
  414.     {
  415.         return $this->employmentType;
  416.     }
  417.     public function setEmploymentType(?string $employmentType): static
  418.     {
  419.         $this->employmentType $employmentType;
  420.         return $this;
  421.     }
  422.     public function getExperienceLevel(): ?string
  423.     {
  424.         return $this->experienceLevel;
  425.     }
  426.     public function setExperienceLevel(?string $experienceLevel): static
  427.     {
  428.         $this->experienceLevel $experienceLevel;
  429.         return $this;
  430.     }
  431.     public function getRemoteWork(): ?string
  432.     {
  433.         return $this->remoteWork;
  434.     }
  435.     public function setRemoteWork(?string $remoteWork): static
  436.     {
  437.         $this->remoteWork $remoteWork;
  438.         return $this;
  439.     }
  440.     public function getCompanyName(): ?string
  441.     {
  442.         return $this->companyName;
  443.     }
  444.     public function setCompanyName(?string $companyName): static
  445.     {
  446.         $this->companyName $companyName;
  447.         return $this;
  448.     }
  449.     public function getAddress(): ?string
  450.     {
  451.         return $this->address;
  452.     }
  453.     public function setAddress(?string $address): static
  454.     {
  455.         $this->address $address;
  456.         return $this;
  457.     }
  458.     public function getCity(): ?string
  459.     {
  460.         return $this->city;
  461.     }
  462.     public function setCity(?string $city): static
  463.     {
  464.         $this->city $city;
  465.         return $this;
  466.     }
  467.     public function getZipcode(): ?string
  468.     {
  469.         return $this->zipcode;
  470.     }
  471.     public function setZipcode(?string $zipcode): static
  472.     {
  473.         $this->zipcode $zipcode;
  474.         return $this;
  475.     }
  476.     public function getCountry(): ?string
  477.     {
  478.         return $this->country;
  479.     }
  480.     public function setCountry(?string $country): static
  481.     {
  482.         $this->country $country;
  483.         return $this;
  484.     }
  485.     public function getWebsite(): ?string
  486.     {
  487.         return $this->website;
  488.     }
  489.     public function setWebsite(?string $website): static
  490.     {
  491.         $this->website $website;
  492.         return $this;
  493.     }
  494.     public function getEmail(): ?string
  495.     {
  496.         return $this->email;
  497.     }
  498.     public function setEmail(?string $email): static
  499.     {
  500.         $this->email $email;
  501.         return $this;
  502.     }
  503.     public function getPhone(): ?string
  504.     {
  505.         return $this->phone;
  506.     }
  507.     public function setPhone(?string $phone): static
  508.     {
  509.         $this->phone $phone;
  510.         return $this;
  511.     }
  512.     public function getCompanyDescription(): ?string
  513.     {
  514.         return $this->companyDescription;
  515.     }
  516.     public function setCompanyDescription(?string $companyDescription): static
  517.     {
  518.         $this->companyDescription $companyDescription;
  519.         return $this;
  520.     }
  521.     public function getRequiredSkills(): ?string
  522.     {
  523.         return $this->requiredSkills;
  524.     }
  525.     public function setRequiredSkills(?string $requiredSkills): static
  526.     {
  527.         $this->requiredSkills $requiredSkills;
  528.         return $this;
  529.     }
  530.     public function getNiceToHaveSkills(): ?string
  531.     {
  532.         return $this->niceToHaveSkills;
  533.     }
  534.     public function setNiceToHaveSkills(?string $niceToHaveSkills): static
  535.     {
  536.         $this->niceToHaveSkills $niceToHaveSkills;
  537.         return $this;
  538.     }
  539.     public function getJobSummary(): ?string
  540.     {
  541.         return $this->jobSummary;
  542.     }
  543.     public function setJobSummary(?string $jobSummary): static
  544.     {
  545.         $this->jobSummary $jobSummary;
  546.         return $this;
  547.     }
  548.     public function getKeyResponsabilities(): ?string
  549.     {
  550.         return $this->keyResponsabilities;
  551.     }
  552.     public function setKeyResponsabilities(?string $keyResponsabilities): static
  553.     {
  554.         $this->keyResponsabilities $keyResponsabilities;
  555.         return $this;
  556.     }
  557.     public function getRequirements(): ?string
  558.     {
  559.         return $this->requirements;
  560.     }
  561.     public function setRequirements(?string $requirements): static
  562.     {
  563.         $this->requirements $requirements;
  564.         return $this;
  565.     }
  566.     public function getSalaryMin(): ?int
  567.     {
  568.         return $this->salaryMin;
  569.     }
  570.     public function setSalaryMin(?int $salaryMin): static
  571.     {
  572.         $this->salaryMin $salaryMin;
  573.         return $this;
  574.     }
  575.     public function getSalaryMax(): ?int
  576.     {
  577.         return $this->salaryMax;
  578.     }
  579.     public function setSalaryMax(?int $salaryMax): static
  580.     {
  581.         $this->salaryMax $salaryMax;
  582.         return $this;
  583.     }
  584.     public function getDevise(): ?string
  585.     {
  586.         return $this->devise;
  587.     }
  588.     public function setDevise(?string $devise): static
  589.     {
  590.         $this->devise $devise;
  591.         return $this;
  592.     }
  593.     public function getSalaryPeriod(): ?string
  594.     {
  595.         return $this->salaryPeriod;
  596.     }
  597.     public function setSalaryPeriod(?string $salaryPeriod): static
  598.     {
  599.         $this->salaryPeriod $salaryPeriod;
  600.         return $this;
  601.     }
  602.     public function getBenefits(): ?string
  603.     {
  604.         return $this->benefits;
  605.     }
  606.     public function setBenefits(?string $benefits): static
  607.     {
  608.         $this->benefits $benefits;
  609.         return $this;
  610.     }
  611.     public function getContactName(): ?string
  612.     {
  613.         return $this->contactName;
  614.     }
  615.     public function setContactName(?string $contactName): static
  616.     {
  617.         $this->contactName $contactName;
  618.         return $this;
  619.     }
  620.     public function getContactEmail(): ?string
  621.     {
  622.         return $this->contactEmail;
  623.     }
  624.     public function setContactEmail(?string $contactEmail): static
  625.     {
  626.         $this->contactEmail $contactEmail;
  627.         return $this;
  628.     }
  629.     public function getContactURL(): ?string
  630.     {
  631.         return $this->contactURL;
  632.     }
  633.     public function setContactURL(?string $contactURL): static
  634.     {
  635.         $this->contactURL $contactURL;
  636.         return $this;
  637.     }
  638.     public function isOnline(): ?bool
  639.     {
  640.         return $this->online;
  641.     }
  642.     public function setOnline(?bool $online): static
  643.     {
  644.         $this->online $online;
  645.         return $this;
  646.     }
  647.     public function getUser(): ?Users
  648.     {
  649.         return $this->user;
  650.     }
  651.     public function setUser(?Users $user): static
  652.     {
  653.         $this->user $user;
  654.         return $this;
  655.     }
  656.     public function getSlug(): ?string
  657.     {
  658.         return $this->slug;
  659.     }
  660.     public function setSlug(?string $slug): static
  661.     {
  662.         $this->slug $slug;
  663.         return $this;
  664.     }
  665.     public function getLocale(): ?string
  666.     {
  667.         return $this->locale;
  668.     }
  669.     public function setLocale(?string $locale): static
  670.     {
  671.         $this->locale $locale;
  672.         return $this;
  673.     }
  674.     public function getEnterprise(): ?Enterprises
  675.     {
  676.         return $this->enterprise;
  677.     }
  678.     public function setEnterprise(?Enterprises $enterprise): static
  679.     {
  680.         $this->enterprise $enterprise;
  681.         return $this;
  682.     }
  683.     public function getCompanySize(): ?string
  684.     {
  685.         return $this->companySize;
  686.     }
  687.     public function setCompanySize(?string $companySize): static
  688.     {
  689.         $this->companySize $companySize;
  690.         return $this;
  691.     }
  692.     public function isValidation(): ?bool
  693.     {
  694.         return $this->validation;
  695.     }
  696.     public function setValidation(?bool $validation): static
  697.     {
  698.         $this->validation $validation;
  699.         return $this;
  700.     }
  701.     public function getShortTitle(): ?string
  702.     {
  703.         return $this->shortTitle;
  704.     }
  705.     public function setShortTitle(?string $shortTitle): static
  706.     {
  707.         $this->shortTitle $shortTitle;
  708.         return $this;
  709.     }
  710.     public function getShortDescription(): ?string
  711.     {
  712.         return $this->shortDescription;
  713.     }
  714.     public function setShortDescription(?string $shortDescription): static
  715.     {
  716.         $this->shortDescription $shortDescription;
  717.         return $this;
  718.     }
  719.     public function getViews(): ?int
  720.     {
  721.         return $this->views;
  722.     }
  723.     public function setViews(?int $views): static
  724.     {
  725.         $this->views $views;
  726.         return $this;
  727.     }
  728.     public function isVerification(): ?bool
  729.     {
  730.         return $this->verification;
  731.     }
  732.     public function setVerification(?bool $verification): static
  733.     {
  734.         $this->verification $verification;
  735.         return $this;
  736.     }
  737.     public function isWebsearch(): ?bool
  738.     {
  739.         return $this->websearch;
  740.     }
  741.     public function setWebsearch(?bool $websearch): static
  742.     {
  743.         $this->websearch $websearch;
  744.         return $this;
  745.     }
  746.     public function getKeywords(): ?string
  747.     {
  748.         return $this->keywords;
  749.     }
  750.     public function setKeywords(?string $keywords): static
  751.     {
  752.         $this->keywords $keywords;
  753.         return $this;
  754.     }
  755. }