src/Entity/PersonCategory.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Enum\PersonGender;
  4. use App\Entity\Traits\Sortable;
  5. use App\Repository\PersonCategoryRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPersonCategoryRepository::class)]
  8. class PersonCategory
  9. {
  10.     use Sortable;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length100)]
  16.     private $name;
  17.     #[ORM\Column(type'string'length10enumTypePersonGender::class)]
  18.     private $gender;
  19.     #[ORM\Column(type'date_immutable')]
  20.     private $yearMin;
  21.     #[ORM\Column(type'date_immutable')]
  22.     private $yearMax;
  23.     #[ORM\ManyToOne(targetEntitySection::class, inversedBy'personCategories')]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private $section;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getName(): ?string
  31.     {
  32.         return $this->name;
  33.     }
  34.     public function setName(string $name): self
  35.     {
  36.         $this->name $name;
  37.         return $this;
  38.     }
  39.     public function getGender(): ?PersonGender
  40.     {
  41.         return $this->gender;
  42.     }
  43.     public function setGender(PersonGender $gender): self
  44.     {
  45.         $this->gender $gender;
  46.         return $this;
  47.     }
  48.     public function getYearMin(): ?\DateTimeImmutable
  49.     {
  50.         return $this->yearMin;
  51.     }
  52.     public function setYearMin(\DateTimeImmutable $yearMin): self
  53.     {
  54.         $this->yearMin $yearMin;
  55.         return $this;
  56.     }
  57.     public function getYearMax(): ?\DateTimeImmutable
  58.     {
  59.         return $this->yearMax;
  60.     }
  61.     public function setYearMax(\DateTimeImmutable $yearMax): self
  62.     {
  63.         $this->yearMax $yearMax;
  64.         return $this;
  65.     }
  66.     public function getSection(): ?Section
  67.     {
  68.         return $this->section;
  69.     }
  70.     public function setSection(?Section $section): self
  71.     {
  72.         $this->section $section;
  73.         return $this;
  74.     }
  75. }