src/Entity/Offer.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Enum\ContratType;
  4. use App\Repository\OfferRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use Symfony\Component\Serializer\Normalizer\NormalizableInterface;
  11. use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
  12. use Symfony\Component\String\Slugger\AsciiSlugger;
  13. /**
  14.  * @ORM\Entity(repositoryClass=OfferRepository::class)
  15.  * @ORM\HasLifecycleCallbacks()
  16.  */
  17. class Offer implements NormalizableInterface
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     public $id;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     public $title;
  29.     /**
  30.      * @ORM\Column(type="integer", nullable=true)
  31.      */
  32.     private $min_tjm;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private $max_tjm;
  37.     /**
  38.      * @ORM\Column(type="boolean")
  39.      */
  40.     public $open_society true;
  41.     /**
  42.      * @ORM\Column(type="string", length=255)
  43.      */
  44.     private $location;
  45.     /**
  46.      * @ORM\Column(type="text")
  47.      */
  48.     public $description;
  49.     /**
  50.      * @ORM\Column(type="integer")
  51.      */
  52.     private $duration_value;
  53.     /**
  54.      * @ORM\Column(type="string", length=255)
  55.      */
  56.     private $duration_type;
  57.     /**
  58.      * @ORM\Column(type="string", length=255)
  59.      */
  60.     private $mode_remote "Non";
  61.     /**
  62.      * @ORM\Column(type="string", length=255)
  63.      */
  64.     private $year_required;
  65.     /**
  66.      * @ORM\Column(type="boolean", nullable=true)
  67.      */
  68.     private $show_coordinate;
  69.     /**
  70.      * @ORM\ManyToOne(targetEntity=Society::class, inversedBy="offers", cascade={"persist"})
  71.      * @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
  72.      */
  73.     private $society;
  74.     /**
  75.      * @ORM\Column(type="boolean", nullable=true)
  76.      */
  77.     private $editedByAdmin;
  78.     // getter et setter pour le champ editedByAdmin
  79.     public function getEditedByAdmin(): ?bool
  80.     {
  81.         return $this->editedByAdmin;
  82.     }
  83.     public function setEditedByAdmin(?bool $editedByAdmin): self
  84.     {
  85.         $this->editedByAdmin $editedByAdmin;
  86.         return $this;
  87.     }
  88.     /**
  89.      * @return mixed
  90.      */
  91.     public function getUser()
  92.     {
  93.         return $this->user;
  94.     }
  95.     /**
  96.      * @param mixed $user
  97.      */
  98.     public function setUser($user): void
  99.     {
  100.         $this->user $user;
  101.     }
  102.     /**
  103.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="offers")
  104.      * @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
  105.      */
  106.     private $user;
  107.     /**
  108.      * @ORM\Column(type="boolean")
  109.      */
  110.     private $renew;
  111.     /**
  112.      * @ORM\Column(type="integer",nullable=true)
  113.      */
  114.     private $invalid;
  115.     /**
  116.      * @return mixed
  117.      */
  118.     public function getInvalid()
  119.     {
  120.         return $this->invalid;
  121.     }
  122.     /**
  123.      * @param mixed $invalid
  124.      */
  125.     public function setInvalid($invalid): void
  126.     {
  127.         $this->invalid $invalid;
  128.     }
  129.     /**
  130.      * @ORM\Column(type="datetime", nullable=true)
  131.      */
  132.     private $created_at;
  133.     /**
  134.      * @ORM\Column(type="datetime", nullable=true)
  135.      */
  136.     private $expire_at;
  137.     /**
  138.      * @ORM\Column(type="string", length=5, nullable=true)
  139.      */
  140.     private $contact_civility;
  141.     /**
  142.      * @ORM\Column(type="string", length=255, nullable=true)
  143.      */
  144.     private $contact_mail;
  145.     /**
  146.      * @ORM\Column(type="string", length=20, nullable=true)
  147.      */
  148.     private $contact_phone;
  149.     /**
  150.      * @ORM\Column(type="string", length=10)
  151.      */
  152.     private $starting_type;
  153.     /**
  154.      * @ORM\Column(type="date", nullable=true)
  155.      */
  156.     private $startin_date;
  157.     /**
  158.      * @ORM\Column(type="string", length=255, nullable=true)
  159.      */
  160.     private $contact_name;
  161.     /**
  162.      * @ORM\Column(type="json", nullable=true)
  163.      */
  164.     private $questions = [];
  165.     /**
  166.      * @ORM\OneToMany(targetEntity=Candidature::class, mappedBy="offer")
  167.      */
  168.     private $candidatures;
  169.     /**
  170.      * @ORM\Column(type="integer", nullable=true)
  171.      */
  172.     private $view 0;
  173.     /**
  174.      * @ORM\Column(type="integer", nullable=true)
  175.      */
  176.     private $unseenCandidature 0;
  177.     /**
  178.      * @ORM\OneToMany(targetEntity=OfferFavorite::class, mappedBy="offer", orphanRemoval=true)
  179.      */
  180.     private $offerFavorites;
  181.     /**
  182.      * @ORM\Column(type="string", length=155, nullable=true)
  183.      */
  184.     private $ville;
  185.     /**
  186.      * @ORM\Column(type="boolean", nullable=true)
  187.      */
  188.     public $priorize;
  189.     /**
  190.      * @ORM\Column(type="boolean", nullable=true)
  191.      */
  192.     public $weekly;
  193.     /**
  194.      * @ORM\Column(type="boolean", nullable=true)
  195.      */
  196.     public $daily;
  197.     /**
  198.      * @ORM\ManyToOne(targetEntity=User::class)
  199.      */
  200.     private $userRecruteur;
  201.     /**
  202.      * @ORM\Column(type="datetime", nullable=true)
  203.      */
  204.     private $dateRemonter;
  205.     /**
  206.      * @ORM\Column(type="boolean", nullable=true)
  207.      */
  208.     private $checkLinkExtern;
  209.     /**
  210.      * @ORM\Column(type="text", nullable=true)
  211.      */
  212.     private $linkExtern;
  213.     /**
  214.      * @ORM\Column(type="string", length=9, nullable=true)
  215.      */
  216.     private $siren;
  217.     /**
  218.      * @ORM\Column(type="boolean", nullable=true)
  219.      */
  220.     private $shareOnSocialNetwork false;
  221.     /**
  222.      * @ORM\Column(type="boolean", nullable=true)
  223.      */
  224.     private $bySuperAdmin false;
  225.     /**
  226.      * @ORM\ManyToOne(targetEntity=User::class)
  227.      * @ORM\JoinColumn(nullable=true)
  228.      */
  229.     private ?User $userByAdmin null;
  230.     /**
  231.      * @ORM\Column(type="string", length=150, nullable=true)
  232.      */
  233.     private $slug null;
  234.     /**
  235.      * @ORM\Column(type="boolean", nullable=true)
  236.      */
  237.     public $siteMapIndex true;
  238.     /**
  239.      * @ORM\OneToMany(targetEntity=OfferVisit::class, mappedBy="offer", orphanRemoval=true)
  240.      */
  241.     private $offerVisits;
  242.     /**
  243.      * @ORM\Column(type="string", length=50, nullable=true)
  244.      */
  245.     private $cdi;
  246.     /**
  247.      * @ORM\Column(type="integer",  nullable=true)
  248.      */
  249.     private $montantMin;
  250.     /**
  251.      * @ORM\Column(type="text",  nullable=true)
  252.      */
  253.     private $reasonRejection;
  254.     /**
  255.      * @ORM\Column(type="json", nullable=true)
  256.      */
  257.     private ?array $contrats = []; // Stocke plusieurs contrats en tant que tableau
  258.     public function getContrats(): ?array
  259.     {
  260.         return $this->contrats;
  261.     }
  262.     public function setContrats(?array $contrats): self
  263.     {
  264.         $this->contrats $contrats// Le tableau de valeurs
  265.         return $this;
  266.     }
  267.     /**
  268.      * @return mixed
  269.      */
  270.     public function getReasonRejection()
  271.     {
  272.         return $this->reasonRejection;
  273.     }
  274.     /**
  275.      * @param mixed $reasonRejection
  276.      */
  277.     public function setReasonRejection($reasonRejection): void
  278.     {
  279.         $this->reasonRejection $reasonRejection;
  280.     }
  281.     /**
  282.      * @ORM\Column(type="boolean", options={"default": 1})
  283.      */
  284.     private $isValidLink true;
  285.     public function getIsValidLink(): ?bool
  286.     {
  287.         return $this->isValidLink;
  288.     }
  289.     public function setIsValidLink(bool $isValidLink): self
  290.     {
  291.         $this->isValidLink $isValidLink;
  292.         return $this;
  293.     }
  294.     /**
  295.      * @ORM\Column(type="integer",  nullable=true)
  296.      */
  297.     private $montantMax;
  298.     /**
  299.      * @return mixed
  300.      */
  301.     public function getCdi()
  302.     {
  303.         return $this->cdi;
  304.     }
  305.     /**
  306.      * @param mixed $cdi
  307.      */
  308.     public function setCdi($cdi): void
  309.     {
  310.         $this->cdi $cdi;
  311.     }
  312.     /**
  313.      * @return mixed
  314.      */
  315.     public function getMontantMin()
  316.     {
  317.         return $this->montantMin;
  318.     }
  319.     /**
  320.      * @param mixed $montantMin
  321.      */
  322.     public function setMontantMin($montantMin): void
  323.     {
  324.         $this->montantMin $montantMin;
  325.     }
  326.     /**
  327.      * @return mixed
  328.      */
  329.     public function getMontantMax()
  330.     {
  331.         return $this->montantMax;
  332.     }
  333.     /**
  334.      * @param mixed $montantMax
  335.      */
  336.     public function setMontantMax($montantMax): void
  337.     {
  338.         $this->montantMax $montantMax;
  339.     }
  340.     public function __construct()
  341.     {
  342.         $this->candidatures = new ArrayCollection();
  343.         $this->offerFavorites = new ArrayCollection();
  344.         $this->offerVisits = new ArrayCollection();
  345.     }
  346.     //---------------------------------------------------------------
  347.     public function updateSlug()
  348.     {
  349.         $slugger = new AsciiSlugger();
  350.         $defaultNum 10000;
  351.         $numero $defaultNum $this->getId();
  352.         $slug strtolower($slugger->slug($this->getTitle() . '-' $numero));
  353.         $this->setSlug($slug);
  354.     }
  355.     public function getCodePostal(): ?string
  356.     {
  357.         if ($this->ville) {
  358.             $villeCP explode(' '$this->getVille());
  359.             $cp $villeCP[0];
  360.             if (strlen($cp) === && ctype_digit($cp)) {
  361.                 return $cp;
  362.             }
  363.         }
  364.         return null;
  365.     }
  366.     //---------------------------------------------------------------
  367.     public function getId(): ?int
  368.     {
  369.         return $this->id;
  370.     }
  371.     public function getTitle(): ?string
  372.     {
  373.         return $this->title;
  374.     }
  375.     public function setTitle(string $title): self
  376.     {
  377.         $this->title $title;
  378.         return $this;
  379.     }
  380.     public function getMinTjm(): ?int
  381.     {
  382.         return $this->min_tjm;
  383.     }
  384.     public function setMinTjm(?int $min_tjm): self
  385.     {
  386.         $this->min_tjm $min_tjm;
  387.         return $this;
  388.     }
  389.     public function getMaxTjm(): ?int
  390.     {
  391.         return $this->max_tjm;
  392.     }
  393.     public function setMaxTjm(?int $max_tjm): self
  394.     {
  395.         $this->max_tjm $max_tjm;
  396.         return $this;
  397.     }
  398.     public function getOpenSociety(): ?bool
  399.     {
  400.         return $this->open_society;
  401.     }
  402.     public function setOpenSociety(bool $open_society): self
  403.     {
  404.         $this->open_society $open_society;
  405.         return $this;
  406.     }
  407.     public function getLocation(): ?string
  408.     {
  409.         return $this->location;
  410.     }
  411.     public function setLocation(?string $location): self
  412.     {
  413.         $this->location $location;
  414.         return $this;
  415.     }
  416.     public function getDescription(): ?string
  417.     {
  418.         return $this->description;
  419.     }
  420.     public function setDescription(string $description): self
  421.     {
  422.         $this->description $description;
  423.         return $this;
  424.     }
  425.     public function getDurationValue(): ?int
  426.     {
  427.         return $this->duration_value;
  428.     }
  429.     public function setDurationValue(?int $duration_value): self
  430.     {
  431.         $this->duration_value $duration_value;
  432.         return $this;
  433.     }
  434.     public function getDurationType(): ?string
  435.     {
  436.         return $this->duration_type;
  437.     }
  438.     public function setDurationType(string $duration_type): self
  439.     {
  440.         $this->duration_type $duration_type;
  441.         return $this;
  442.     }
  443.     public function getModeRemote(): ?string
  444.     {
  445.         return $this->mode_remote;
  446.     }
  447.     public function setModeRemote(string $mode_remote): self
  448.     {
  449.         $this->mode_remote $mode_remote;
  450.         return $this;
  451.     }
  452.     public function getYearRequired(): ?string
  453.     {
  454.         return $this->year_required;
  455.     }
  456.     public function setYearRequired(string $year_required): self
  457.     {
  458.         $this->year_required $year_required;
  459.         return $this;
  460.     }
  461.     public function getShowCoordinate(): ?bool
  462.     {
  463.         return $this->show_coordinate;
  464.     }
  465.     public function setShowCoordinate(?bool $show_coordinate): self
  466.     {
  467.         $this->show_coordinate $show_coordinate;
  468.         return $this;
  469.     }
  470.     public function getSociety(): ?Society
  471.     {
  472.         return $this->society;
  473.     }
  474.     public function setSociety(?Society $society): self
  475.     {
  476.         $this->society $society;
  477.         return $this;
  478.     }
  479.     public function getRenew(): ?bool
  480.     {
  481.         return $this->renew;
  482.     }
  483.     public function setRenew(bool $renew): self
  484.     {
  485.         $this->renew $renew;
  486.         return $this;
  487.     }
  488.     public function getCreatedAt(): ?\DateTimeInterface
  489.     {
  490.         return $this->created_at;
  491.     }
  492.     public function setCreatedAt(?\DateTimeInterface $created_at): self
  493.     {
  494.         $this->created_at $created_at;
  495.         return $this;
  496.     }
  497.     /**
  498.      * @ORM\PrePersist
  499.      */
  500.     public function setCreatedAtAutomatically()
  501.     {
  502.         if ($this->getCreatedAt() === null) {
  503.             $this->setCreatedAt(new \DateTime());
  504.         }
  505.         if ($this->getLinkExtern() !== null or $this->user !== null) {
  506.             $expire = (new \DateTime())->add(new \DateInterval('P2M'));
  507.         } else {
  508.             $expire = (new \DateTime())->add(new \DateInterval('P6M'));
  509.         }
  510.         $this->setExpireAt($expire);
  511.     }
  512.     public function getExpireAt(): ?\DateTimeInterface
  513.     {
  514.         return $this->expire_at;
  515.     }
  516.     public function setExpireAt(?\DateTimeInterface $expire_at): self
  517.     {
  518.         $this->expire_at $expire_at;
  519.         return $this;
  520.     }
  521.     public function getCostText(): string
  522.     {
  523.         if (empty($this->max_tjm) && empty($this->min_tjm)) {
  524.             return 'Selon profil';
  525.         }
  526.         if (empty($this->min_tjm)) {
  527.             return 'Max ' $this->max_tjm '€ HT';
  528.         }
  529.         if (empty($this->max_tjm)) {
  530.             return 'Min ' $this->min_tjm '€ HT';
  531.         }
  532.         // Affiche une seule valeur si min = max
  533.         if ($this->min_tjm == $this->max_tjm) {
  534.             return $this->min_tjm '€ HT';
  535.         }
  536.         return $this->min_tjm ' - ' $this->max_tjm '€ HT';
  537.     }
  538.     public function getCostTextCdi(): string
  539.     {
  540.         if (empty($this->montantMax) && empty($this->montantMin)) {
  541.             return 'Selon profil';
  542.         }
  543.         if (empty($this->montantMin)) {
  544.             return 'Max ' $this->formatK($this->montantMax) . '€ annuel';
  545.         }
  546.         if (empty($this->montantMax)) {
  547.             return 'Min ' $this->formatMin($this->montantMin) . '€ annuel';
  548.         }
  549.         // Affiche une seule valeur si min = max
  550.         if ($this->montantMin == $this->montantMax) {
  551.             return $this->formatK($this->montantMin) . '€ annuel';
  552.         }
  553.         return $this->formatMin($this->montantMin) . ' - ' $this->formatK($this->montantMax) . '€ annuel';
  554.     }
  555.     /**
  556.      * Formate un nombre en ajoutant 'K' si >= 1000 (uniquement pour le max)
  557.      */
  558.     private function formatK(int $amount): string
  559.     {
  560.         return ($amount >= 1000) ? ($amount 1000) . 'K' : (string)$amount;
  561.     }
  562.     /**
  563.      * Formate le min en supprimant les milliers inutiles
  564.      */
  565.     private function formatMin(int $amount): string
  566.     {
  567.         return ($amount >= 1000) ? (string)($amount 1000) : (string)$amount;
  568.     }
  569.     public function getDurationText(): string
  570.     {
  571.         $ending = ($this->duration_type === 'an' && $this->duration_value 1) ? 's' '';
  572.         return $this->duration_value ' ' $this->duration_type $ending;
  573.     }
  574.     public function getContactCivility(): ?string
  575.     {
  576.         return $this->contact_civility;
  577.     }
  578.     public function setContactCivility(?string $contact_civility): self
  579.     {
  580.         $this->contact_civility $contact_civility;
  581.         return $this;
  582.     }
  583.     public function getContactMail(): ?string
  584.     {
  585.         return $this->contact_mail;
  586.     }
  587.     public function setContactMail(?string $contact_mail): self
  588.     {
  589.         $this->contact_mail $contact_mail;
  590.         return $this;
  591.     }
  592.     public function getContactPhone(): ?string
  593.     {
  594.         return $this->contact_phone;
  595.     }
  596.     public function setContactPhone(?string $contact_phone): self
  597.     {
  598.         $this->contact_phone $contact_phone;
  599.         return $this;
  600.     }
  601.     public function getStartingType(): ?string
  602.     {
  603.         return $this->starting_type;
  604.     }
  605.     public function setStartingType(string $starting_type): self
  606.     {
  607.         $this->starting_type $starting_type;
  608.         return $this;
  609.     }
  610.     public function getStartinDate(): ?\DateTimeInterface
  611.     {
  612.         return $this->startin_date;
  613.     }
  614.     public function setStartinDate(?\DateTimeInterface $startin_date): self
  615.     {
  616.         $this->startin_date $startin_date;
  617.         return $this;
  618.     }
  619.     public function getContactName(): ?string
  620.     {
  621.         return $this->contact_name;
  622.     }
  623.     public function setContactName(?string $contact_name): self
  624.     {
  625.         $this->contact_name $contact_name;
  626.         return $this;
  627.     }
  628.     public function getQuestions(): ?array
  629.     {
  630.         return $this->questions;
  631.     }
  632.     public function setQuestions(?array $questions): self
  633.     {
  634.         if (is_array($questions)) {
  635.             foreach ($questions as $key => $question) {
  636.                 if (empty($question)) {
  637.                     unset($questions[$key]);
  638.                 }
  639.             }
  640.         }
  641.         $this->questions $questions;
  642.         return $this;
  643.     }
  644.     /**
  645.      * @return Collection|Candidature[]
  646.      */
  647.     public function getCandidatures(): Collection
  648.     {
  649.         return $this->candidatures;
  650.     }
  651.     public function addCandidature(Candidature $candidature): self
  652.     {
  653.         if (!$this->candidatures->contains($candidature)) {
  654.             $this->candidatures[] = $candidature;
  655.             $candidature->setOffer($this);
  656.         }
  657.         return $this;
  658.     }
  659.     public function removeCandidature(Candidature $candidature): self
  660.     {
  661.         if ($this->candidatures->removeElement($candidature)) {
  662.             // set the owning side to null (unless already changed)
  663.             if ($candidature->getOffer() === $this) {
  664.                 $candidature->setOffer(null);
  665.             }
  666.         }
  667.         return $this;
  668.     }
  669.     public function getView(): ?int
  670.     {
  671.         return $this->view ?? 0;
  672.     }
  673.     public function setView(?int $view): self
  674.     {
  675.         $this->view $view;
  676.         return $this;
  677.     }
  678.     public function incrementView(): self
  679.     {
  680.         $this->view++;
  681.         return $this;
  682.     }
  683.     public function getUnseenCandidature(): ?int
  684.     {
  685.         return $this->unseenCandidature ?? 0;
  686.     }
  687.     public function setUnseenCandidature(?int $unseenCandidature): self
  688.     {
  689.         $this->unseenCandidature $unseenCandidature;
  690.         return $this;
  691.     }
  692.     public function incrementUnseenCandidature(): self
  693.     {
  694.         $this->unseenCandidature++;
  695.         return $this;
  696.     }
  697.     public function normalize(NormalizerInterface $normalizerstring $format null, array $context = []): array
  698.     {
  699.         return [
  700.             'title' => $this->getTitle(),
  701.             'cost_min' => $this->getMinTjm(),
  702.             'cost_max' => $this->getMaxTjm(),
  703.             'location' => $this->getLocation(),
  704.             'created_at' => $this->getCreatedAt(),
  705.             'expire_at' => $this->getExpireAt(),
  706.             'description' => $this->getDescription(),
  707.             'mode_remote' => $this->getModeRemote(),
  708.             'timestamp_create' => $this->getCreatedAt()->getTimestamp(),
  709.             'priorize' => $this->getPriorize(),
  710.             'daily' => $this->getDaily(),
  711.             'weekly' => $this->getWeekly(),
  712.             'identification' => $this->getId(),
  713.         ];
  714.     }
  715.     /**
  716.      * @return Collection|OfferFavorite[]
  717.      */
  718.     public function getOfferFavorites(): Collection
  719.     {
  720.         return $this->offerFavorites;
  721.     }
  722.     public function addOfferFavorite(OfferFavorite $offerFavorite): self
  723.     {
  724.         if (!$this->offerFavorites->contains($offerFavorite)) {
  725.             $this->offerFavorites[] = $offerFavorite;
  726.             $offerFavorite->setOffer($this);
  727.         }
  728.         return $this;
  729.     }
  730.     public function removeOfferFavorite(OfferFavorite $offerFavorite): self
  731.     {
  732.         if ($this->offerFavorites->removeElement($offerFavorite)) {
  733.             // set the owning side to null (unless already changed)
  734.             if ($offerFavorite->getOffer() === $this) {
  735.                 $offerFavorite->setOffer(null);
  736.             }
  737.         }
  738.         return $this;
  739.     }
  740.     public function getVille(): ?string
  741.     {
  742.         return $this->ville;
  743.     }
  744.     public function setVille(?string $ville): self
  745.     {
  746.         $this->ville $ville;
  747.         return $this;
  748.     }
  749.     public function getAddress(): ?string
  750.     {
  751.         return empty($this->ville) ? $this->location $this->ville;
  752.     }
  753.     public function getPriorize(): ?bool
  754.     {
  755.         return $this->priorize;
  756.     }
  757.     public function setPriorize(?bool $priorize): self
  758.     {
  759.         $this->priorize $priorize;
  760.         return $this;
  761.     }
  762.     public function getWeekly(): ?bool
  763.     {
  764.         return $this->weekly;
  765.     }
  766.     public function setWeekly(?bool $weekly): self
  767.     {
  768.         $this->weekly $weekly;
  769.         return $this;
  770.     }
  771.     public function getDaily(): ?bool
  772.     {
  773.         return $this->daily;
  774.     }
  775.     public function setDaily(?bool $daily): self
  776.     {
  777.         $this->daily $daily;
  778.         return $this;
  779.     }
  780.     public function isToday(): bool
  781.     {
  782.         $date = new \DateTime();
  783.         $matchDate $this->getCreatedAt();
  784.         $interval $date->diff($matchDate);
  785.         return $interval->days == 0;
  786.     }
  787.     public function isOpenSociety(): ?bool
  788.     {
  789.         return $this->open_society;
  790.     }
  791.     public function isShowCoordinate(): ?bool
  792.     {
  793.         return $this->show_coordinate;
  794.     }
  795.     public function isRenew(): ?bool
  796.     {
  797.         return $this->renew;
  798.     }
  799.     public function isPriorize(): ?bool
  800.     {
  801.         return $this->priorize;
  802.     }
  803.     public function isWeekly(): ?bool
  804.     {
  805.         return $this->weekly;
  806.     }
  807.     public function isDaily(): ?bool
  808.     {
  809.         return $this->daily;
  810.     }
  811.     public function getUserRecruteur(): ?User
  812.     {
  813.         return $this->userRecruteur;
  814.     }
  815.     public function setUserRecruteur(?User $userRecruteur): self
  816.     {
  817.         $this->userRecruteur $userRecruteur;
  818.         return $this;
  819.     }
  820.     public function getDateRemonter(): ?\DateTimeInterface
  821.     {
  822.         return $this->dateRemonter;
  823.     }
  824.     public function setDateRemonter(?\DateTimeInterface $dateRemonter): Offer
  825.     {
  826.         $this->dateRemonter $dateRemonter;
  827.         return $this;
  828.     }
  829.     public function isCheckLinkExtern(): ?bool
  830.     {
  831.         return $this->checkLinkExtern;
  832.     }
  833.     public function setCheckLinkExtern(?bool $checkLinkExtern): self
  834.     {
  835.         $this->checkLinkExtern $checkLinkExtern;
  836.         return $this;
  837.     }
  838.     public function getLinkExtern(): ?string
  839.     {
  840.         return $this->linkExtern;
  841.     }
  842.     public function setLinkExtern(?string $linkExtern): self
  843.     {
  844.         $this->linkExtern $linkExtern;
  845.         return $this;
  846.     }
  847.     public function getSiren(): ?string
  848.     {
  849.         return $this->siren;
  850.     }
  851.     public function setSiren(?string $siren): self
  852.     {
  853.         $this->siren $siren;
  854.         return $this;
  855.     }
  856.     public function isShareOnSocialNetwork(): ?bool
  857.     {
  858.         return $this->shareOnSocialNetwork;
  859.     }
  860.     public function setShareOnSocialNetwork(?bool $shareOnSocialNetwork): self
  861.     {
  862.         $this->shareOnSocialNetwork $shareOnSocialNetwork;
  863.         return $this;
  864.     }
  865.     public function isBySuperAdmin(): ?bool
  866.     {
  867.         return $this->bySuperAdmin;
  868.     }
  869.     public function setBySuperAdmin(?bool $bySuperAdmin): self
  870.     {
  871.         $this->bySuperAdmin $bySuperAdmin;
  872.         return $this;
  873.     }
  874.     public function getUserByAdmin(): ?User
  875.     {
  876.         return $this->userByAdmin;
  877.     }
  878.     public function setUserByAdmin(?User $userByAdmin): self
  879.     {
  880.         $this->userByAdmin $userByAdmin;
  881.         return $this;
  882.     }
  883.     public function getSlug(): ?string
  884.     {
  885.         return $this->slug;
  886.     }
  887.     public function setSlug(?string $slug): self
  888.     {
  889.         $this->slug $slug;
  890.         return $this;
  891.     }
  892.     /**
  893.      * @return Collection<int, OfferVisit>
  894.      */
  895.     public function getOfferVisits(): Collection
  896.     {
  897.         return $this->offerVisits;
  898.     }
  899.     public function addOfferVisit(OfferVisit $offerVisit): self
  900.     {
  901.         if (!$this->offerVisits->contains($offerVisit)) {
  902.             $this->offerVisits->add($offerVisit);
  903.             $offerVisit->setOffer($this);
  904.         }
  905.         return $this;
  906.     }
  907.     public function removeOfferVisit(OfferVisit $offerVisit): self
  908.     {
  909.         if ($this->offerVisits->removeElement($offerVisit)) {
  910.             // set the owning side to null (unless already changed)
  911.             if ($offerVisit->getOffer() === $this) {
  912.                 $offerVisit->setOffer(null);
  913.             }
  914.         }
  915.         return $this;
  916.     }
  917.     public function isSiteMapIndex(): ?bool
  918.     {
  919.         return $this->siteMapIndex;
  920.     }
  921.     public function setSiteMapIndex(?bool $siteMapIndex): self
  922.     {
  923.         $this->siteMapIndex $siteMapIndex;
  924.         return $this;
  925.     }
  926. }