<?php
declare(strict_types=1);
namespace App\Domains\Plan\Domain\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'plan')]
class Plan
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int|null $id = null;
#[ORM\Column(type: 'string', length: 255)]
private string $name;
#[ORM\Column(type: 'integer')]
private int $dailyWordLimit;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private float $price;
#[ORM\Column(type: 'boolean')]
private bool $isDefault = false;
public function __construct(
string $name,
int $dailyWordLimit,
float $price,
bool $isDefault = false
) {
$this->name = $name;
$this->dailyWordLimit = $dailyWordLimit;
$this->price = $price;
$this->isDefault = $isDefault;
}
// Getters
public function getId(): int|null
{
return $this->id;
}
public function getName(): string
{
return $this->name;
}
public function getDailyWordLimit(): int
{
return $this->dailyWordLimit;
}
public function getPrice(): float
{
return $this->price;
}
public function isDefault(): bool
{
return $this->isDefault;
}
}