collection-crud/src/Entity/LensTrait.php

76 lines
2.5 KiB
PHP

<?php declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
trait LensTrait
{
use PurchasePriceTrait;
use GetSetTrait;
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: TRUE)]
private readonly ?string $brand;
#[ORM\Column(name: 'coatings', type: 'string', length: 64, nullable: TRUE)]
private readonly ?string $coatings;
#[ORM\Column(name: 'product_line', type: 'string', length: 64, nullable: TRUE)]
private readonly ?string $productLine;
#[ORM\Column(name: 'model', type: 'string', length: 64, nullable: TRUE)]
private readonly ?string $model;
#[ORM\Column(name: 'min_f_stop', type: 'string', length: 10, nullable: TRUE)]
private readonly ?string $minFStop;
#[ORM\Column(name: 'max_f_stop', type: 'float', precision: 10, scale: 0, nullable: TRUE)]
private readonly ?float $maxFStop;
#[ORM\Column(name: 'min_focal_length', type: 'integer', nullable: TRUE)]
private readonly ?int $minFocalLength;
#[ORM\Column(name: 'max_focal_length', type: 'integer', nullable: TRUE)]
private readonly ?int $maxFocalLength;
#[ORM\Column(name: 'serial', type: 'string', length: 10, nullable: TRUE)]
private readonly ?string $serial;
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
private readonly ?string $notes;
#[ORM\Column(name: 'image_size', type: 'string', nullable: FALSE, options: ['default' => '35mm'])]
private string $imageSize = '35mm';
#[ORM\Column(name: 'mount', type: 'string', length: 40, nullable: TRUE)]
private readonly ?string $mount;
#[ORM\Column(name: 'front_filter_size', type: 'decimal', precision: 10, scale: 0, nullable: TRUE)]
private readonly ?string $frontFilterSize;
#[ORM\Column(name: 'rear_filter_size', type: 'decimal', precision: 10, scale: 0, nullable: TRUE)]
private readonly ?string $rearFilterSize;
#[ORM\Column(name: 'is_teleconverter', type: 'boolean', nullable: FALSE)]
private bool $isTeleconverter = FALSE;
#[ORM\Column(name: 'design_elements', type: 'smallint', nullable: TRUE)]
private readonly ?int $designElements;
#[ORM\Column(name: 'design_groups', type: 'smallint', nullable: TRUE)]
private readonly ?int $designGroups;
#[ORM\Column(name: 'aperture_blades', type: 'smallint', nullable: TRUE)]
private readonly ?int $apertureBlades;
public function __get(string $name): mixed
{
if (property_exists($this, $name))
{
return $this->$name;
}
return null;
}
}