src/Entity/ReviewerSettings.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReviewerSettingsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ReviewerSettingsRepository::class)
  7.  */
  8. class ReviewerSettings
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\OneToOne(targetEntity=User::class, inversedBy="reviewerSettings", cascade={"persist", "remove"})
  18.      */
  19.     private $user;
  20.     /**
  21.      * @ORM\Column(type="text", nullable=true)
  22.      */
  23.     private $candidateDeclineComments;
  24.     /**
  25.      * @ORM\Column(type="text", nullable=true)
  26.      */
  27.     private $candidateRecommendations;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getUser(): ?User
  33.     {
  34.         return $this->user;
  35.     }
  36.     public function setUser(?User $user): self
  37.     {
  38.         $this->user $user;
  39.         return $this;
  40.     }
  41.     public function getCandidateDeclineComments(): ?string
  42.     {
  43.         return $this->candidateDeclineComments;
  44.     }
  45.     public function setCandidateDeclineComments(?string $candidateDeclineComments): self
  46.     {
  47.         $this->candidateDeclineComments $candidateDeclineComments;
  48.         return $this;
  49.     }
  50.     public function getCandidateDeclineCommentsAsArray(): ?array
  51.     {
  52.         if ($this->candidateDeclineComments === null) {
  53.             return null;
  54.         }
  55.         return json_decode($this->candidateDeclineCommentstrue);
  56.     }
  57.     public function setCandidateDeclineCommentsAsArray(?array $candidateDeclineComments,
  58.                                                        bool $resetIndexes true): self
  59.     {
  60.         if ($resetIndexes && $candidateDeclineComments !== null) {
  61.             $candidateDeclineComments array_values($candidateDeclineComments);
  62.         }
  63.         if ($candidateDeclineComments !== null) {
  64.             $this->candidateDeclineComments json_encode($candidateDeclineComments,
  65.                 JSON_UNESCAPED_UNICODE JSON_UNESCAPED_SLASHES);
  66.         }
  67.         return $this;
  68.     }
  69.     public function getCandidateRecommendations(): ?string
  70.     {
  71.         return $this->candidateRecommendations;
  72.     }
  73.     public function setCandidateRecommendations(?string $candidateRecommendations): self
  74.     {
  75.         $this->candidateRecommendations $candidateRecommendations;
  76.         return $this;
  77.     }
  78.     public function getCandidateRecommendationsAsArray(): ?array
  79.     {
  80.         if ($this->candidateRecommendations === null) {
  81.             return null;
  82.         }
  83.         return json_decode($this->candidateRecommendationstrue);
  84.     }
  85.     public function setCandidateRecommendationsAsArray(?array $candidateRecommendations,
  86.                                                        bool $resetIndexes true): self
  87.     {
  88.         if ($resetIndexes && $candidateRecommendations !== null) {
  89.             $candidateRecommendations array_values($candidateRecommendations);
  90.         }
  91.         if ($candidateRecommendations !== null) {
  92.             $this->candidateRecommendations json_encode($candidateRecommendations,
  93.                 JSON_UNESCAPED_UNICODE JSON_UNESCAPED_SLASHES);
  94.         }
  95.         return $this;
  96.     }
  97. }