src/Entity/Skill.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Enum\SkillLevel;
  4. use App\Repository\SkillRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=SkillRepository::class)
  8.  */
  9. class Skill
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     public $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     public $name;
  21.     /**
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     public $level;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Profile::class, inversedBy="skills")
  27.      * @ORM\JoinColumn(nullable=false,onDelete="CASCADE")
  28.      */
  29.     private $profile;
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): self
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function getLevel(): ?int
  44.     {
  45.         return $this->level;
  46.     }
  47.     public function setLevel(int $level): self
  48.     {
  49.         $this->level $level;
  50.         return $this;
  51.     }
  52.     public function getSkillLabel() :string
  53.     {
  54.         return array_search($this->levelSkillLevel::LIST);
  55.     }
  56.     public function getProfile(): ?Profile
  57.     {
  58.         return $this->profile;
  59.     }
  60.     public function setProfile(?Profile $profile): self
  61.     {
  62.         $this->profile $profile;
  63.         return $this;
  64.     }
  65. }