src/Entity/JobConfiguration/Job/Favorites/Favorites.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\JobConfiguration\Job\Favorites;
  3. use App\Entity\EntityIdentifier;
  4. use App\Entity\JobConfiguration\Job;
  5. use App\Entity\User;
  6. use App\Repository\JobConfiguration\Job\Favorites\FavoritesRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FavoritesRepository::class)
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class Favorites
  13. {
  14.     use EntityIdentifier;
  15.     
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="favorites")
  24.      */
  25.     private $user;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Job::class, inversedBy="favorites")
  28.      */
  29.     private $job;
  30.     /**
  31.      * @ORM\Column(type="boolean", nullable=true)
  32.      */
  33.     private $alreadyExercised;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=JobAsLike::class, inversedBy="favorites")
  36.      */
  37.     private $jobAsLike;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=DurationForJob::class, inversedBy="favoritesNextTimeToExcerceJob")
  40.      */
  41.     private $nextTimeToExcerceJob;
  42.     /**
  43.      * @ORM\Column(type="integer", nullable=true, options={"default"="0"})
  44.      */
  45.     private $position;
  46.     /**
  47.      * @ORM\Column(type="boolean", nullable=true)
  48.      */
  49.     private $wantToExerceJob;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $motivation;
  54.     
  55.     public function __construct ()
  56.     {
  57.         $this->position 0;
  58.     }
  59.     
  60.     public function getId(): ?int
  61.                       {
  62.                           return $this->id;
  63.                       }
  64.     public function getUser(): ?User
  65.     {
  66.         return $this->user;
  67.     }
  68.     public function setUser(?User $user): self
  69.     {
  70.         $this->user $user;
  71.         return $this;
  72.     }
  73.     public function getJob(): ?Job
  74.     {
  75.         return $this->job;
  76.     }
  77.     public function setJob(?Job $job): self
  78.     {
  79.         $this->job $job;
  80.         return $this;
  81.     }
  82.     public function isAlreadyExercised(): ?bool
  83.     {
  84.         return $this->alreadyExercised;
  85.     }
  86.     public function setAlreadyExercised(?bool $alreadyExercised): self
  87.     {
  88.         $this->alreadyExercised $alreadyExercised;
  89.         return $this;
  90.     }
  91.     public function getJobAsLike(): ?JobAsLike
  92.     {
  93.         return $this->jobAsLike;
  94.     }
  95.     public function setJobAsLike(?JobAsLike $jobAsLike): self
  96.     {
  97.         $this->jobAsLike $jobAsLike;
  98.         return $this;
  99.     }
  100.     
  101.     public function getNextTimeToExcerceJob(): ?DurationForJob
  102.     {
  103.         return $this->nextTimeToExcerceJob;
  104.     }
  105.     public function setNextTimeToExcerceJob(?DurationForJob $nextTimeToExcerceJob): self
  106.     {
  107.         $this->nextTimeToExcerceJob $nextTimeToExcerceJob;
  108.         return $this;
  109.     }
  110.     public function getPosition(): ?int
  111.     {
  112.         return $this->position;
  113.     }
  114.     public function setPosition(?int $position): self
  115.     {
  116.         $this->position $position;
  117.         return $this;
  118.     }
  119.     public function isWantToExerceJob(): ?bool
  120.     {
  121.         return $this->wantToExerceJob;
  122.     }
  123.     public function setWantToExerceJob(?bool $wantToExerceJob): self
  124.     {
  125.         $this->wantToExerceJob $wantToExerceJob;
  126.         return $this;
  127.     }
  128.     public function getMotivation(): ?string
  129.     {
  130.         return $this->motivation;
  131.     }
  132.     public function setMotivation(?string $motivation): self
  133.     {
  134.         $this->motivation $motivation;
  135.         return $this;
  136.     }
  137.     
  138.     public function getMotivationLabel() {
  139.         switch ($this->motivation) {
  140.             case "first":
  141.                 return "C’est mon 1er choix !";
  142.             case "second":
  143.                 return "Ça me dirait bien 🙂";
  144.             case "third":
  145.                 return "Si j’ai rien d’autre…";
  146.         }
  147.         return "";
  148.     }
  149. }