collection-crud/src/Entity/CameraTrait.php

217 lines
4.6 KiB
PHP
Raw Normal View History

2018-02-14 15:08:03 -05:00
<?php declare(strict_types=1);
2017-11-30 15:06:13 -05:00
namespace App\Entity;
2017-11-30 15:06:13 -05:00
2022-02-17 14:00:50 -05:00
use Doctrine\ORM\Mapping as ORM;
2018-02-14 15:08:03 -05:00
/**
* Trait CameraTrait
*
* Shared columns for camera, and previously_owned_camera tables
*/
2017-11-30 15:06:13 -05:00
trait CameraTrait
{
2022-03-03 10:53:48 -05:00
use PurchasePriceTrait;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
#[ORM\ManyToOne(targetEntity: 'CameraType')]
2022-03-03 11:15:12 -05:00
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id', nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly CameraType $type;
2022-02-18 11:34:25 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly string $brand;
2022-02-18 11:34:25 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly string $mount;
2022-02-18 11:34:25 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly string $model;
2022-02-18 11:34:25 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly bool $isDigital;
2022-02-18 11:34:25 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'crop_factor', type: 'decimal', precision: 10, scale: 0, nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private string $cropFactor = '1.0';
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly bool $isWorking;
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
2022-03-03 10:53:48 -05:00
private readonly ?string $notes;
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: FALSE)]
2022-03-03 10:53:48 -05:00
private readonly string $serial;
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)]
private bool $formerlyOwned = FALSE;
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'battery_type', type: 'string', nullable: TRUE)]
2022-03-03 10:53:48 -05:00
private readonly ?string $batteryType;
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'film_format', type: 'string', nullable: TRUE)]
2022-03-03 10:53:48 -05:00
private ?string $filmFormat = '135';
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
#[ORM\Column(name: 'received', type: 'boolean', nullable: TRUE)]
private ?bool $received = FALSE;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getId(): int
{
return $this->id;
}
2017-11-30 15:06:13 -05:00
2022-03-03 11:15:12 -05:00
public function setType(?CameraType $type = NULL): self
2022-03-03 10:53:48 -05:00
{
$this->type = $type;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getType(): CameraType
{
return $this->type;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setBrand(string $brand): self
{
$this->brand = $brand;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getBrand(): string
{
return $this->brand;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setMount(string $mount): self
{
$this->mount = $mount;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getMount(): string
{
return $this->mount;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setModel(string $model): self
{
$this->model = $model;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getModel(): string
{
return $this->model;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setIsDigital(bool $isDigital): self
{
$this->isDigital = $isDigital;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getIsDigital(): bool
{
return $this->isDigital;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setCropFactor(string $cropFactor): self
{
$this->cropFactor = $cropFactor;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getCropFactor(): string
{
return $this->cropFactor;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setIsWorking(bool $isWorking): self
{
$this->isWorking = $isWorking;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getIsWorking(): bool
{
return $this->isWorking;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function setNotes(string $notes): self
{
$this->notes = $notes;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getNotes(): string
{
return $this->notes ?? '';
}
public function setSerial(string $serial): self
{
$this->serial = $serial;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getSerial(): string
{
return $this->serial ?? '';
}
public function setFormerlyOwned(bool $formerlyOwned): self
{
$this->formerlyOwned = $formerlyOwned;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getFormerlyOwned(): bool
{
return $this->formerlyOwned;
}
public function setBatteryType(string $batteryType): self
{
$this->batteryType = $batteryType;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getBatteryType(): string
{
return $this->batteryType ?? '';
}
public function setFilmFormat(string $filmFormat): self
{
$this->filmFormat = $filmFormat;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getFilmFormat(): string
{
return $this->filmFormat ?? '';
}
public function setReceived(bool $received): self
{
$this->received = $received;
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
return $this;
}
2017-11-30 15:06:13 -05:00
2022-03-03 10:53:48 -05:00
public function getReceived(): bool
{
return $this->received;
}
2017-11-30 15:06:13 -05:00
}