collection-crud/src/Entity/GpuCore.php

54 lines
1.4 KiB
PHP
Raw Normal View History

2022-09-29 20:09:31 -04:00
<?php declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
2022-10-07 16:04:34 -04:00
use Stringable;
2022-09-29 20:09:31 -04:00
#[ORM\Table(name: 'gpu_core', schema: 'collection')]
#[ORM\Entity]
2022-10-07 16:04:34 -04:00
class GpuCore implements Stringable
2022-09-29 20:09:31 -04:00
{
2022-09-30 10:49:02 -04:00
use GetSetTrait;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private int $id;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\ManyToOne(targetEntity: 'Brand')]
2022-10-07 16:04:34 -04:00
#[ORM\OrderBy(['name' => 'asc'])]
#[ORM\JoinColumn(name: 'brand_id', referencedColumnName: 'id', nullable: FALSE)]
2022-09-30 10:49:02 -04:00
private Brand $brand;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\Column(name: 'name')]
2022-10-13 22:26:33 -04:00
private string $name;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\Column(name: 'variant', nullable: TRUE)]
2022-10-13 22:26:33 -04:00
private ?string $variant;
2022-09-29 20:09:31 -04:00
#[ORM\Column(name: 'generation_name', nullable: TRUE)]
2022-10-13 22:26:33 -04:00
private string $generationName;
2022-09-29 20:09:31 -04:00
2022-10-07 16:04:34 -04:00
#[ORM\Column(name: 'generation_link', nullable: TRUE)]
private ?string $generationLink = '';
#[ORM\Column(name: 'architecture', nullable: TRUE)]
2022-10-13 22:26:33 -04:00
private string $architecture;
2022-09-29 20:09:31 -04:00
#[ORM\Column(name: 'architecture_link', nullable: TRUE)]
2022-10-13 22:26:33 -04:00
private string $architectureLink;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\Column(name: 'process_node', nullable: TRUE)]
2022-10-13 22:26:33 -04:00
private ?int $processNode;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
public function __toString(): string
{
2022-10-07 22:00:14 -04:00
$name = ( ! empty($this->variant))
? "{$this->name} ({$this->variant})"
: $this->name;
return "{$name} - [{$this->brand}] $this->generationName";
2022-09-30 10:49:02 -04:00
}
2022-09-29 20:09:31 -04:00
}