src/Domains/Plan/Domain/Entity/Plan.php line 11

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Domains\Plan\Domain\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity]
  6. #[ORM\Table(name'plan')]
  7. class Plan
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private int|null $id null;
  13.     #[ORM\Column(type'string'length255)]
  14.     private string $name;
  15.     #[ORM\Column(type'integer')]
  16.     private int $dailyWordLimit;
  17.     #[ORM\Column(type'decimal'precision10scale2)]
  18.     private float $price;
  19.     #[ORM\Column(type'boolean')]
  20.     private bool $isDefault false;
  21.     public function __construct(
  22.         string $name,
  23.         int $dailyWordLimit,
  24.         float $price,
  25.         bool $isDefault false
  26.     ) {
  27.         $this->name $name;
  28.         $this->dailyWordLimit $dailyWordLimit;
  29.         $this->price $price;
  30.         $this->isDefault $isDefault;
  31.     }
  32.     // Getters
  33.     public function getId(): int|null
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getName(): string
  38.     {
  39.         return $this->name;
  40.     }
  41.     public function getDailyWordLimit(): int
  42.     {
  43.         return $this->dailyWordLimit;
  44.     }
  45.     public function getPrice(): float
  46.     {
  47.         return $this->price;
  48.     }
  49.     public function isDefault(): bool
  50.     {
  51.         return $this->isDefault;
  52.     }
  53. }