2018-02-14 15:08:03 -05:00
|
|
|
<?php declare(strict_types=1);
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2018-02-14 16:42:39 -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
|
|
|
|
*
|
2018-02-14 16:42:39 -05:00
|
|
|
* @package App\Entity
|
2018-02-14 15:08:03 -05:00
|
|
|
*/
|
2017-11-30 15:06:13 -05:00
|
|
|
trait CameraTrait
|
|
|
|
{
|
|
|
|
use PurchasePriceTrait;
|
|
|
|
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\ManyToOne(targetEntity: 'CameraType')]
|
2022-02-18 11:34:25 -05:00
|
|
|
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id', nullable: false)]
|
|
|
|
private readonly CameraType $type;
|
|
|
|
|
|
|
|
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: false)]
|
|
|
|
private readonly string $brand;
|
|
|
|
|
|
|
|
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: false)]
|
|
|
|
private readonly string $mount;
|
|
|
|
|
|
|
|
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: false)]
|
|
|
|
private readonly string $model;
|
|
|
|
|
|
|
|
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: false)]
|
|
|
|
private readonly bool $isDigital;
|
|
|
|
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\Column(name: 'crop_factor', type: 'decimal', precision: 10, scale: 0, nullable: false)]
|
2022-02-17 14:00:50 -05:00
|
|
|
private string $cropFactor = '1.0';
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: false)]
|
|
|
|
private readonly bool $isWorking;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
|
|
|
|
private readonly ?string $notes;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: false)]
|
|
|
|
private readonly string $serial;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: false)]
|
2022-02-17 14:00:50 -05:00
|
|
|
private bool $formerlyOwned = FALSE;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
#[ORM\Column(name: 'battery_type', type: 'string', nullable: true)]
|
|
|
|
private readonly ?string $batteryType;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\Column(name: 'film_format', type: 'string', nullable: true)]
|
2022-02-17 14:00:50 -05:00
|
|
|
private ?string $filmFormat = '135';
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\Column(name: 'received', type: 'boolean', nullable: true)]
|
2022-02-17 14:00:50 -05:00
|
|
|
private ?bool $received = FALSE;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getId(): int
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setType(CameraType $type = null): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->type = $type;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getType(): CameraType
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->type;
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:00:50 -05:00
|
|
|
public function setBrand(string $brand): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->brand = $brand;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getBrand(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->brand;
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:00:50 -05:00
|
|
|
public function setMount(string $mount): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->mount = $mount;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getMount(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->mount;
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:00:50 -05:00
|
|
|
public function setModel(string $model): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->model = $model;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getModel(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->model;
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:00:50 -05:00
|
|
|
public function setIsDigital(bool $isDigital): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->isDigital = $isDigital;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getIsDigital(): bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->isDigital;
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:00:50 -05:00
|
|
|
public function setCropFactor(string $cropFactor): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->cropFactor = $cropFactor;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getCropFactor(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->cropFactor;
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:00:50 -05:00
|
|
|
public function setIsWorking(bool $isWorking): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->isWorking = $isWorking;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getIsWorking(): bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->isWorking;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function setNotes(string $notes): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->notes = $notes;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-07-11 09:18:46 -04:00
|
|
|
public function getNotes(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
2018-07-11 09:18:46 -04:00
|
|
|
return $this->notes ?? '';
|
2017-11-30 15:06:13 -05:00
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function setSerial(string $serial): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->serial = $serial;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-07-11 09:18:46 -04:00
|
|
|
public function getSerial(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
2018-07-11 09:18:46 -04:00
|
|
|
return $this->serial ?? '';
|
2017-11-30 15:06:13 -05:00
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function setFormerlyOwned(bool $formerlyOwned): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->formerlyOwned = $formerlyOwned;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getFormerlyOwned(): bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->formerlyOwned;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function setBatteryType(string $batteryType): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->batteryType = $batteryType;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function getBatteryType(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
2022-02-18 11:34:25 -05:00
|
|
|
return $this->batteryType ?? '';
|
2017-11-30 15:06:13 -05:00
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function setFilmFormat(string $filmFormat): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->filmFormat = $filmFormat;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getFilmFormat(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
2022-02-18 11:34:25 -05:00
|
|
|
return $this->filmFormat ?? '';
|
2017-11-30 15:06:13 -05:00
|
|
|
}
|
|
|
|
|
2022-02-18 11:34:25 -05:00
|
|
|
public function setReceived(bool $received): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->received = $received;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getReceived(): bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->received;
|
|
|
|
}
|
|
|
|
}
|