<?php
namespace App\Entity;
use App\Repository\PlanRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PlanRepository::class)]
#[ORM\Table(name: 'plans')]
class Plan
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $name = null;
#[ORM\Column(length: 50)]
private ?string $cpu = null;
#[ORM\Column(length: 50)]
private ?string $ram = null;
#[ORM\Column(length: 100)]
private ?string $storage = null;
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]
private ?string $price = null;
#[ORM\Column]
private ?bool $popular = false;
#[ORM\Column(length: 50, nullable: true)]
private ?string $category = null; // e.g. 'kvm', 'dedicated'
#[ORM\Column(nullable: true)]
private ?int $sortOrder = null;
// Getters & Setters
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getCpu(): ?string
{
return $this->cpu;
}
public function setCpu(string $cpu): static
{
$this->cpu = $cpu;
return $this;
}
public function getRam(): ?string
{
return $this->ram;
}
public function setRam(string $ram): static
{
$this->ram = $ram;
return $this;
}
public function getStorage(): ?string
{
return $this->storage;
}
public function setStorage(string $storage): static
{
$this->storage = $storage;
return $this;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(string $price): static
{
$this->price = $price;
return $this;
}
public function isPopular(): ?bool
{
return $this->popular;
}
public function setPopular(bool $popular): static
{
$this->popular = $popular;
return $this;
}
public function getCategory(): ?string
{
return $this->category;
}
public function setCategory(?string $category): static
{
$this->category = $category;
return $this;
}
public function getSortOrder(): ?int
{
return $this->sortOrder;
}
public function setSortOrder(?int $sortOrder): static
{
$this->sortOrder = $sortOrder;
return $this;
}
#[ORM\Column(options: ['default' => false])]
private ?bool $soldOut = false;
#[ORM\Column(options: ['default' => false])]
private ?bool $trialEnabled = false;
public function isSoldOut(): ?bool
{
return $this->soldOut;
}
public function setSoldOut(bool $soldOut): static
{
$this->soldOut = $soldOut;
return $this;
}
public function isTrialEnabled(): ?bool
{
return $this->trialEnabled;
}
public function setTrialEnabled(bool $trialEnabled): static
{
$this->trialEnabled = $trialEnabled;
return $this;
}
}