collection-crud/src/Entity/CameraTrait.php

378 lines
5.5 KiB
PHP

<?php declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Trait CameraTrait
*
* Shared columns for camera, and previously_owned_camera tables
*
* @package App\Entity
*/
trait CameraTrait
{
use PurchasePriceTrait;
/**
* @var CameraType
*/
#[ORM\ManyToOne(targetEntity: 'CameraType')]
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id')]private readonly ?CameraType $type;
/**
* @var string
*/
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: false)]private readonly string $brand;
/**
* @var string
*/
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: false)]private readonly string $mount;
/**
* @var string
*/
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: false)]private readonly string $model;
/**
* @var boolean
*/
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: false)]private readonly bool $isDigital;
/**
* @var string
*/
#[ORM\Column(name: 'crop_factor', type: 'decimal', precision: 10, scale: 0, nullable: false)]
private string $cropFactor = '1.0';
/**
* @var boolean
*/
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: false)]private readonly bool $isWorking;
/**
* @var string
*/
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]private readonly ?string $notes;
/**
* @var string
*/
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: false)]private readonly string $serial;
/**
* @var boolean
*/
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: false)]
private bool $formerlyOwned = FALSE;
/**
* @var string
*/
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: true)]
private $purchasePrice;
/**
* @var string
*/
#[ORM\Column(name: 'battery_type', type: 'string', nullable: true)]private readonly ?string $batteryType;
/**
* @var string
*/
#[ORM\Column(name: 'film_format', type: 'string', nullable: true)]
private ?string $filmFormat = '135';
/**
* @var boolean
*/
#[ORM\Column(name: 'received', type: 'boolean', nullable: true)]
private ?bool $received = FALSE;
/**
* Get id
*/
public function getId(): int
{
return $this->id;
}
/**
* Set type
*
*
*/
public function setType(CameraType $type = null): self
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return CameraType
*/
public function getType(): ?CameraType
{
return $this->type;
}
/**
* Set brand
*
*
*/
public function setBrand(string $brand): self
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand(): ?string
{
return $this->brand;
}
/**
* Set mount
*
*
*/
public function setMount(string $mount): self
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount(): ?string
{
return $this->mount;
}
/**
* Set model
*
*
*/
public function setModel(string $model): self
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel(): ?string
{
return $this->model;
}
/**
* Set isDigital
*
*
*/
public function setIsDigital(bool $isDigital): self
{
$this->isDigital = $isDigital;
return $this;
}
/**
* Get isDigital
*
* @return boolean
*/
public function getIsDigital(): ?bool
{
return $this->isDigital;
}
/**
* Set cropFactor
*
*
*/
public function setCropFactor(string $cropFactor): self
{
$this->cropFactor = $cropFactor;
return $this;
}
/**
* Get cropFactor
*/
public function getCropFactor(): string
{
return $this->cropFactor;
}
/**
* Set isWorking
*
*
*/
public function setIsWorking(bool $isWorking): self
{
$this->isWorking = $isWorking;
return $this;
}
/**
* Get isWorking
*
* @return boolean
*/
public function getIsWorking(): ?bool
{
return $this->isWorking;
}
/**
* Set notes
*
* @param string $notes
*/
public function setNotes($notes): self
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*/
public function getNotes(): string
{
return $this->notes ?? '';
}
/**
* Set serial
*
* @param string $serial
*/
public function setSerial($serial): self
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*/
public function getSerial(): string
{
return $this->serial ?? '';
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*/
public function setFormerlyOwned($formerlyOwned): self
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned(): ?bool
{
return $this->formerlyOwned;
}
/**
* Set batteryType
*
* @param string $batteryType
*/
public function setBatteryType($batteryType): self
{
$this->batteryType = $batteryType;
return $this;
}
/**
* Get batteryType
*
* @return string
*/
public function getBatteryType(): ?string
{
return $this->batteryType;
}
/**
* Set filmFormat
*
* @param string $filmFormat
*/
public function setFilmFormat($filmFormat): self
{
$this->filmFormat = $filmFormat;
return $this;
}
/**
* Get filmFormat
*/
public function getFilmFormat(): string
{
return $this->filmFormat;
}
/**
* Set received
*
* @param boolean $received
*/
public function setReceived($received): self
{
$this->received = $received;
return $this;
}
/**
* Get received
*/
public function getReceived(): bool
{
return $this->received;
}
}