src/Entity/Offer.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Controller\Admin\AdminController;
  5. use App\Controller\Admin\OfferController;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use App\Repository\OfferRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\DBAL\Types\Types;
  11. use Doctrine\ORM\Mapping as ORM;
  12. #[ORM\Entity(repositoryClassOfferRepository::class)]
  13. #[ApiResource(
  14.     description'GET collection of offers from interfor',
  15.     itemOperations: [
  16.         'get' => [
  17.             'normalization_context' => ['groups' => ['show:list']],
  18.             'denormalization_context' => ['groups' => ['show:list']],
  19.         ],
  20.     ],
  21. )]
  22. class Offer
  23. {
  24.     #[ORM\Id]
  25.     #[ORM\GeneratedValue]
  26.     #[ORM\Column]
  27.     private ?int $id null;
  28.     #[ORM\Column(length510nullabletrue)]
  29.     #[Groups(['show:list'])]
  30.     private ?string $job_title null;
  31.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  32.     #[Groups(['show:list'])]
  33.     private ?string $job_description null;
  34.     #[ORM\ManyToMany(targetEntityTraining::class, inversedBy'offers')]
  35.     private Collection $training;
  36.     #[ORM\Column(nullabletrue)]
  37.     #[Groups(['show:list'])]
  38.     private ?bool $state null;
  39.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  40.     #[Groups(['show:list'])]
  41.     private ?\DateTimeInterface $date null;
  42.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  43.     #[Groups(['show:list'])]
  44.     private ?\DateTimeInterface $start_date null;
  45.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  46.     private ?\DateTimeInterface $cv_book_relaunch_date null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $contact null;
  49.     #[ORM\Column(nullabletrue)]
  50.     private ?bool $isArchived false;
  51.     #[ORM\Column(length255)]
  52.     private ?string $company_siret null;
  53.     #[ORM\Column(length255)]
  54.     private ?string $company_name null;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     private ?string $company_address null;
  57.     #[ORM\Column(length255nullabletrue)]
  58.     #[Groups(['show:list'])]
  59.     private ?string $company_city null;
  60.     #[ORM\Column(length255nullabletrue)]
  61.     private ?string $company_zipcode null;
  62.     #[ORM\Column(length255)]
  63.     private ?string $company_email null;
  64.     #[ORM\Column(length255)]
  65.     private ?string $company_phone null;
  66.     #[ORM\Column(length255nullabletrue)]
  67.     private ?string $idcc null;
  68.     #[ORM\OneToMany(mappedBy'offer'targetEntityApplication::class)]
  69.     private Collection $applications;
  70.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  71.     private ?\DateTimeInterface $follow_up_step_date null;
  72.     #[ORM\ManyToOne(inversedBy'offers')]
  73.     private ?FollowUpOfferStep $followUpOfferStep null;
  74.     #[ORM\Column(length255nullabletrue)]
  75.     private ?string $opco null;
  76.     #[ORM\OneToMany(mappedBy'offer'targetEntityBookCv::class)]
  77.     private Collection $bookCvs;
  78.     #[ORM\OneToMany(mappedBy'offer'targetEntityOfferComment::class)]
  79.     private Collection $comments;
  80.     #[ORM\OneToMany(mappedBy'offer'targetEntityHistoryOffers::class)]
  81.     private Collection $historyOffers;
  82.     #[ORM\Column(nullabletrue)]
  83.     private ?bool $company null;
  84.     public function __construct()
  85.     {
  86.         $this->training = new ArrayCollection();
  87.         $this->applications = new ArrayCollection();
  88.         $this->bookCvs = new ArrayCollection();
  89.         $this->comments = new ArrayCollection();
  90.         $this->historyOffers = new ArrayCollection();
  91.     }
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function getJobTitle(): ?string
  97.     {
  98.         return $this->job_title;
  99.     }
  100.     public function setJobTitle(?string $job_title): self
  101.     {
  102.         $this->job_title $job_title;
  103.         return $this;
  104.     }
  105.     public function getJobDescription(): ?string
  106.     {
  107.         return $this->job_description;
  108.     }
  109.     public function setJobDescription(?string $job_description): self
  110.     {
  111.         $this->job_description $job_description;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @return Collection<int, Training>
  116.      */
  117.     public function getTraining(): Collection
  118.     {
  119.         return $this->training;
  120.     }
  121.     public function addTraining(Training $training): self
  122.     {
  123.         if (!$this->training->contains($training)) {
  124.             $this->training->add($training);
  125.         }
  126.         return $this;
  127.     }
  128.     public function removeTraining(Training $training): self
  129.     {
  130.         $this->training->removeElement($training);
  131.         return $this;
  132.     }
  133.     public function isState(): ?bool
  134.     {
  135.         return $this->state;
  136.     }
  137.     public function setState(?bool $state): self
  138.     {
  139.         $this->state $state;
  140.         return $this;
  141.     }
  142.     public function getDate(): ?\DateTimeInterface
  143.     {
  144.         return $this->date;
  145.     }
  146.     public function setDate(?\DateTimeInterface $date): self
  147.     {
  148.         $this->date $date;
  149.         return $this;
  150.     }
  151.     public function getStartDate(): ?\DateTimeInterface
  152.     {
  153.         return $this->start_date;
  154.     }
  155.     public function setStartDate(?\DateTimeInterface $start_date): self
  156.     {
  157.         $this->start_date $start_date;
  158.         return $this;
  159.     }
  160.     public function getCvBookRelaunchDate(): ?\DateTimeInterface
  161.     {
  162.         return $this->cv_book_relaunch_date;
  163.     }
  164.     public function setCvBookRelaunchDate(?\DateTimeInterface $cv_book_relaunch_date): self
  165.     {
  166.         $this->cv_book_relaunch_date $cv_book_relaunch_date;
  167.         return $this;
  168.     }
  169.     public function getContact(): ?string
  170.     {
  171.         return $this->contact;
  172.     }
  173.     public function setContact(?string $contact): self
  174.     {
  175.         $this->contact $contact;
  176.         return $this;
  177.     }
  178.     public function isIsArchived(): ?bool
  179.     {
  180.         return $this->isArchived;
  181.     }
  182.     public function setIsArchived(?bool $isArchived): self
  183.     {
  184.         $this->isArchived $isArchived;
  185.         return $this;
  186.     }
  187.     public function getCompanySiret(): ?string
  188.     {
  189.         return $this->company_siret;
  190.     }
  191.     public function setCompanySiret(string $company_siret): self
  192.     {
  193.         $this->company_siret $company_siret;
  194.         return $this;
  195.     }
  196.     public function getCompanyName(): ?string
  197.     {
  198.         return $this->company_name;
  199.     }
  200.     public function setCompanyName(string $company_name): self
  201.     {
  202.         $this->company_name $company_name;
  203.         return $this;
  204.     }
  205.     public function getCompanyAddress(): ?string
  206.     {
  207.         return $this->company_address;
  208.     }
  209.     public function setCompanyAddress(?string $company_address): self
  210.     {
  211.         $this->company_address $company_address;
  212.         return $this;
  213.     }
  214.     public function getCompanyCity(): ?string
  215.     {
  216.         return $this->company_city;
  217.     }
  218.     public function setCompanyCity(?string $company_city): self
  219.     {
  220.         $this->company_city $company_city;
  221.         return $this;
  222.     }
  223.     public function getCompanyZipcode(): ?string
  224.     {
  225.         return $this->company_zipcode;
  226.     }
  227.     public function setCompanyZipcode(?string $company_zipcode): self
  228.     {
  229.         $this->company_zipcode $company_zipcode;
  230.         return $this;
  231.     }
  232.     public function getCompanyEmail(): ?string
  233.     {
  234.         return $this->company_email;
  235.     }
  236.     public function setCompanyEmail(string $company_email): self
  237.     {
  238.         $this->company_email $company_email;
  239.         return $this;
  240.     }
  241.     public function getCompanyPhone(): ?string
  242.     {
  243.         return $this->company_phone;
  244.     }
  245.     public function setCompanyPhone(string $company_phone): self
  246.     {
  247.         $this->company_phone $company_phone;
  248.         return $this;
  249.     }
  250.     public function getIdcc(): ?string
  251.     {
  252.         return $this->idcc;
  253.     }
  254.     public function setIdcc(?string $idcc): self
  255.     {
  256.         $this->idcc $idcc;
  257.         return $this;
  258.     }
  259.     /**
  260.      * @return Collection<int, Application>
  261.      */
  262.     public function getApplications(): Collection
  263.     {
  264.         return $this->applications;
  265.     }
  266.     public function addApplication(Application $application): self
  267.     {
  268.         if (!$this->applications->contains($application)) {
  269.             $this->applications->add($application);
  270.             $application->setOffer($this);
  271.         }
  272.         return $this;
  273.     }
  274.     public function removeApplication(Application $application): self
  275.     {
  276.         if ($this->applications->removeElement($application)) {
  277.             // set the owning side to null (unless already changed)
  278.             if ($application->getOffer() === $this) {
  279.                 $application->setOffer(null);
  280.             }
  281.         }
  282.         return $this;
  283.     }
  284.     public function getFollowUpStepDate(): ?\DateTimeInterface
  285.     {
  286.         return $this->follow_up_step_date;
  287.     }
  288.     public function setFollowUpStepDate(?\DateTimeInterface $follow_up_step_date): self
  289.     {
  290.         $this->follow_up_step_date $follow_up_step_date;
  291.         return $this;
  292.     }
  293.     public function getFollowUpOfferStep(): ?FollowUpOfferStep
  294.     {
  295.         return $this->followUpOfferStep;
  296.     }
  297.     public function setFollowUpOfferStep(?FollowUpOfferStep $followUpOfferStep): self
  298.     {
  299.         $this->followUpOfferStep $followUpOfferStep;
  300.         return $this;
  301.     }
  302.     public function getOpco(): ?string
  303.     {
  304.         return $this->opco;
  305.     }
  306.     public function setOpco(?string $opco): self
  307.     {
  308.         $this->opco $opco;
  309.         return $this;
  310.     }
  311.     /**
  312.      * @return Collection<int, BookCv>
  313.      */
  314.     public function getBookCvs(): Collection
  315.     {
  316.         return $this->bookCvs;
  317.     }
  318.     public function addBookCv(BookCv $bookCv): self
  319.     {
  320.         if (!$this->bookCvs->contains($bookCv)) {
  321.             $this->bookCvs->add($bookCv);
  322.             $bookCv->setOffer($this);
  323.         }
  324.         return $this;
  325.     }
  326.     public function removeBookCv(BookCv $bookCv): self
  327.     {
  328.         if ($this->bookCvs->removeElement($bookCv)) {
  329.             // set the owning side to null (unless already changed)
  330.             if ($bookCv->getOffer() === $this) {
  331.                 $bookCv->setOffer(null);
  332.             }
  333.         }
  334.         return $this;
  335.     }
  336.     /**
  337.      * @return Collection<int, OfferComment>
  338.      */
  339.     public function getComments(): Collection
  340.     {
  341.         return $this->comments;
  342.     }
  343.     public function addText(OfferComment $comments): self
  344.     {
  345.         if (!$this->comments->contains($comments)) {
  346.             $this->comments->add($comments);
  347.             $comments->setOffer($this);
  348.         }
  349.         return $this;
  350.     }
  351.     public function removeComments(OfferComment $comments): self
  352.     {
  353.         if ($this->comments->removeElement($comments)) {
  354.             // set the owning side to null (unless already changed)
  355.             if ($comments->getOffer() === $this) {
  356.                 $comments->setOffer(null);
  357.             }
  358.         }
  359.         return $this;
  360.     }
  361.     /**
  362.      * @return Collection<int, HistoryOffers>
  363.      */
  364.     public function getHistoryOffers(): Collection
  365.     {
  366.         return $this->historyOffers;
  367.     }
  368.     public function addHistoryOffer(HistoryOffers $historyOffer): self
  369.     {
  370.         if (!$this->historyOffers->contains($historyOffer)) {
  371.             $this->historyOffers->add($historyOffer);
  372.             $historyOffer->setOffer($this);
  373.         }
  374.         return $this;
  375.     }
  376.     public function removeHistoryOffer(HistoryOffers $historyOffer): self
  377.     {
  378.         if ($this->historyOffers->removeElement($historyOffer)) {
  379.             // set the owning side to null (unless already changed)
  380.             if ($historyOffer->getOffer() === $this) {
  381.                 $historyOffer->setOffer(null);
  382.             }
  383.         }
  384.         return $this;
  385.     }
  386.     public function isCompany(): ?bool
  387.     {
  388.         return $this->company;
  389.     }
  390.     public function setCompany(?bool $company): self
  391.     {
  392.         $this->company $company;
  393.         return $this;
  394.     }
  395. }