<?php
namespace App\Entity;
use App\Repository\ReviewerSettingsRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ReviewerSettingsRepository::class)
*/
class ReviewerSettings
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity=User::class, inversedBy="reviewerSettings", cascade={"persist", "remove"})
*/
private $user;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $candidateDeclineComments;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $candidateRecommendations;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getCandidateDeclineComments(): ?string
{
return $this->candidateDeclineComments;
}
public function setCandidateDeclineComments(?string $candidateDeclineComments): self
{
$this->candidateDeclineComments = $candidateDeclineComments;
return $this;
}
public function getCandidateDeclineCommentsAsArray(): ?array
{
if ($this->candidateDeclineComments === null) {
return null;
}
return json_decode($this->candidateDeclineComments, true);
}
public function setCandidateDeclineCommentsAsArray(?array $candidateDeclineComments,
bool $resetIndexes = true): self
{
if ($resetIndexes && $candidateDeclineComments !== null) {
$candidateDeclineComments = array_values($candidateDeclineComments);
}
if ($candidateDeclineComments !== null) {
$this->candidateDeclineComments = json_encode($candidateDeclineComments,
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
return $this;
}
public function getCandidateRecommendations(): ?string
{
return $this->candidateRecommendations;
}
public function setCandidateRecommendations(?string $candidateRecommendations): self
{
$this->candidateRecommendations = $candidateRecommendations;
return $this;
}
public function getCandidateRecommendationsAsArray(): ?array
{
if ($this->candidateRecommendations === null) {
return null;
}
return json_decode($this->candidateRecommendations, true);
}
public function setCandidateRecommendationsAsArray(?array $candidateRecommendations,
bool $resetIndexes = true): self
{
if ($resetIndexes && $candidateRecommendations !== null) {
$candidateRecommendations = array_values($candidateRecommendations);
}
if ($candidateRecommendations !== null) {
$this->candidateRecommendations = json_encode($candidateRecommendations,
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
return $this;
}
}