<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\AdditionalSkillRepository") */class AdditionalSkill implements \JsonSerializable{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity="App\Entity\Skill") */ private $skill; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $experience; /** * @ORM\ManyToOne(targetEntity="App\Entity\SkillLevel") */ private $level; /** * @ORM\ManyToOne(targetEntity="App\Entity\Candidate", inversedBy="additionalSkills") */ private $candidate; public function getId(): ?int { return $this->id; } public function getSkill(): ?Skill { return $this->skill; } public function setSkill(?Skill $skill): self { $this->skill = $skill; return $this; } public function getExperience(): ?string { return $this->experience; } public function setExperience(?string $experience): self { $this->experience = $experience; return $this; } public function getLevel(): ?SkillLevel { return $this->level; } public function setLevel(?SkillLevel $level): self { $this->level = $level; return $this; } /** * @return Candidate */ public function getCandidate(): ?Candidate { return $this->candidate; } /** * @param Candidate $candidate * * @return self */ public function setCandidate(Candidate $candidate): self { $this->candidate = $candidate; return $this; } public function __toString() { return (string) $this->getSkill(); } /** * Specify data which should be serialized to JSON * * @link https://php.net/manual/en/jsonserializable.jsonserialize.php * @return mixed data which can be serialized by <b>json_encode</b>, * which is a value of any type other than a resource. * @since 5.4.0 */ public function jsonSerialize() { return [ 'id' => $this->getId(), 'skill' => $this->getSkill(), 'experience' => $this->getExperience(), 'level' => $this->getLevel(), ]; }}