src/Entity/Membership.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MembershipRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassMembershipRepository::class)]
  6. class Membership
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\Column]
  13.     private ?\DateTimeImmutable $startedAt null;
  14.     #[ORM\Column]
  15.     private ?\DateTimeImmutable $endAt null;
  16.     #[ORM\Column]
  17.     private ?bool $active null;
  18.     #[ORM\ManyToOne(inversedBy'memberships')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Company $company null;
  21.     public function __construct()
  22.     {
  23.         $this->active true;
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getStartedAt(): ?\DateTimeImmutable
  30.     {
  31.         return $this->startedAt;
  32.     }
  33.     public function setStartedAt(\DateTimeImmutable $startedAt): self
  34.     {
  35.         $this->startedAt $startedAt;
  36.         return $this;
  37.     }
  38.     public function getEndAt(): ?\DateTimeImmutable
  39.     {
  40.         return $this->endAt;
  41.     }
  42.     public function setEndAt(\DateTimeImmutable $endAt): self
  43.     {
  44.         $this->endAt $endAt;
  45.         return $this;
  46.     }
  47.     public function isActive(): ?bool
  48.     {
  49.         return $this->active;
  50.     }
  51.     public function setActive(bool $active): self
  52.     {
  53.         $this->active $active;
  54.         return $this;
  55.     }
  56.     public function getCompany(): ?Company
  57.     {
  58.         return $this->company;
  59.     }
  60.     public function setCompany(?Company $company): self
  61.     {
  62.         $this->company $company;
  63.         return $this;
  64.     }
  65. }