collection-crud/src/Entity/GpuCore.php

53 lines
1.3 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-25 14:52:58 -04:00
class GpuCore implements Stringable {
2022-11-17 15:32:57 -05:00
use GetSet;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -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-10-25 14:52:58 -04:00
#[ORM\ManyToOne(targetEntity: 'Brand', fetch: 'EAGER')]
#[ORM\OrderBy(['name' => 'asc'])]
#[ORM\JoinColumn(name: 'brand_id', referencedColumnName: 'id', nullable: FALSE)]
private Brand $brand;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'name')]
private string $name;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'variant', nullable: TRUE)]
private ?string $variant;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'generation_name', nullable: TRUE)]
private string $generationName;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'generation_link', nullable: TRUE)]
private ?string $generationLink = '';
2022-10-07 16:04:34 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'architecture', nullable: TRUE)]
private string $architecture;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'architecture_link', nullable: TRUE)]
private string $architectureLink;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
#[ORM\Column(name: 'process_node', nullable: TRUE)]
private ?int $processNode;
2022-09-29 20:09:31 -04:00
2022-10-25 14:52:58 -04:00
public function __toString(): string
{
2022-10-07 22:00:14 -04:00
$name = ( ! empty($this->variant))
2022-10-25 14:52:58 -04:00
? "$this->name ($this->variant)"
2022-10-07 22:00:14 -04:00
: $this->name;
2022-10-25 14:52:58 -04:00
return "$name - [$this->brand] $this->generationName";
}
2022-09-29 20:09:31 -04:00
}