collection-crud/src/Entity/Gpu.php

167 lines
4.2 KiB
PHP

<?php declare(strict_types=1);
namespace App\Entity;
use App\Enum\{CardBus, SlotKey};
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'gpu', schema: 'collection')]
#[ORM\Entity]
class Gpu {
use GetSet;
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private int $id;
#[ORM\ManyToOne(targetEntity: 'Brand', fetch: 'EAGER')]
#[ORM\OrderBy(['name' => 'asc'])]
#[ORM\JoinColumn(name: 'gpu_brand_id', referencedColumnName: 'id', nullable: FALSE)]
private Brand $gpuBrand;
#[ORM\ManyToOne(targetEntity: 'GpuCore', fetch: 'EAGER')]
#[ORM\OrderBy(['brand' => 'asc', 'name' => 'asc'])]
#[ORM\JoinColumn(name: 'gpu_core_id', referencedColumnName: 'id', nullable: TRUE)]
private ?GpuCore $gpuCore = NULL;
#[ORM\Column(name: 'reference_model_name', nullable: FALSE)]
private string $modelName;
#[ORM\ManyToOne(targetEntity: 'Brand', fetch: 'EAGER')]
#[ORM\OrderBy(['name' => 'asc'])]
#[ORM\JoinColumn(name: 'board_brand_id', referencedColumnName: 'id', nullable: TRUE)]
private ?Brand $boardBrand = NULL;
#[ORM\Column(name: 'alternate_model_name', nullable: TRUE)]
private ?string $alternateModelName = '';
#[ORM\Column(
name: 'card_key',
type: 'string',
enumType: SlotKey::class,
options: [
'comment' => 'The shape of the card connector',
'default' => 'PCIe x16',
]
)]
private SlotKey $cardKey = SlotKey::PCIE_X16;
#[ORM\Column(
name: 'bus_interface',
type: 'string',
nullable: TRUE,
enumType: CardBus::class,
options: ['comment' => 'The type of electrical bus this card uses']
)]
private ?CardBus $busInterface;
#[ORM\Column(
name: 'slot_span',
options: [
'comment' => 'How many expansion slots the card occupies',
'default' => 1,
],
)]
private int $slotSpan = 1;
#[ORM\Column(name: 'molex_power', options: ['default' => 0])]
private int $molexPower = 0;
#[ORM\Column(name: 'pcie_6_pin', options: ['default' => 0])]
private int $pcie6power = 0;
#[ORM\Column(name: 'pcie_8_pin', options: ['default' => 0])]
private int $pcie8power = 0;
#[ORM\Column(
name: 'tdp',
nullable: TRUE,
options: ['comment' => 'Thermal Design Power (in Watts)']
)]
private ?int $tdp = 0;
#[ORM\Column(
name: 'base_clock',
nullable: TRUE,
options: ['comment' => 'Base speed of the gpu core, in MHz']
)]
private ?int $baseClock;
#[ORM\Column(
name: 'boost_clock',
nullable: TRUE,
options: ['comment' => 'GPU core boost clock, in MHz']
)]
private ?int $boostClock;
#[ORM\Column(
name: 'memory_clock',
nullable: TRUE,
options: ['comment' => 'Clock speed of the VRAM, in MHz']
)]
private ?int $memoryClock;
#[ORM\Column(
name: 'memory_size',
nullable: TRUE,
options: ['comment' => 'VRAM size, in MiB']
)]
private ?int $memorySize;
#[ORM\Column(
name: 'memory_bus',
nullable: TRUE,
options: ['comment' => 'The width of the memory bus in bits']
)]
private ?int $memoryBus;
#[ORM\Column(name: 'memory_type', nullable: TRUE)]
private ?string $memoryType;
#[ORM\Column(name: 'shading_units', nullable: TRUE)]
private ?int $shadingUnits;
#[ORM\Column(name: 'tmus', nullable: TRUE)]
private ?int $tmus;
#[ORM\Column(name: 'rops', nullable: TRUE)]
private ?int $rops;
#[ORM\Column(name: 'compute_units', nullable: TRUE)]
private ?int $computeUnits;
#[ORM\Column(name: 'l1_cache', nullable: TRUE)]
private ?string $l1cache;
#[ORM\Column(name: 'l2_cache', nullable: TRUE)]
private ?string $l2cache;
#[ORM\Column(name: 'direct_x_support', nullable: TRUE)]
private ?string $directXSupport;
#[ORM\Column(name: 'opengl_support', nullable: TRUE)]
private ?string $openGLSupport;
#[ORM\Column(name: 'opencl_support', nullable: TRUE)]
private ?string $openCLSupport;
#[ORM\Column(name: 'vulkan_support', nullable: TRUE)]
private ?string $vulkanSupport;
#[ORM\Column(name: 'shader_model', nullable: TRUE)]
private ?string $shaderModel;
#[ORM\Column(name: 'link', nullable: TRUE)]
private ?string $link;
#[ORM\Column(name: 'count', nullable: FALSE, options: ['default' => 1])]
private int $count = 1;
#[ORM\Column(name: 'acquired', nullable: FALSE, options: ['default' => TRUE])]
private bool $acquired;
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
private ?string $notes = '';
}