<?phpnamespace App\Entity\Telegram\AgentPublicBot;use App\Entity\BaseEntity;use App\Entity\VPN\Service\Plan;use App\Repository\Telegram\AgentPublicBot\BotPlanRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;#[ORM\Entity(repositoryClass: BotPlanRepository::class)]class BotPlan extends BaseEntity{ #[ORM\Id] #[ORM\Column(type: 'guid', unique: true)] #[ORM\GeneratedValue(strategy: 'CUSTOM')] #[ORM\CustomIdGenerator(class: UuidGenerator::class)] private ?string $id = null; #[ORM\ManyToOne(inversedBy: 'botPlans')] #[ORM\JoinColumn(nullable: false)] private ?Bot $bot = null; #[ORM\Column(type: Types::BIGINT)] private ?string $price = null; #[ORM\ManyToOne(inversedBy: 'botPlans')] private ?Plan $plan = null; public function getId(): ?string { return $this->id; } public function getBot(): ?Bot { return $this->bot; } public function setBot(?Bot $bot): static { $this->bot = $bot; return $this; } public function getPrice(): ?string { return $this->price; } public function setPrice(string $price): static { $this->price = $price; return $this; } public function formatSizeUnits($bytes): string { if ($bytes >= 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = $bytes . ' bytes'; } elseif ($bytes == 1) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } public function getPlan(): ?Plan { return $this->plan; } public function setPlan(?Plan $plan): static { $this->plan = $plan; return $this; }}