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;
|
|
|
|
|
|
|
|
/**
|
2018-02-14 15:08:03 -05:00
|
|
|
* @var CameraType
|
2017-11-30 15:06:13 -05:00
|
|
|
*/
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\ManyToOne(targetEntity: 'CameraType')]
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id')]private readonly ?CameraType $type;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: false)]private readonly string $brand;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: false)]private readonly string $mount;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: false)]private readonly string $model;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: false)]private readonly bool $isDigital;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: false)]private readonly bool $isWorking;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]private readonly ?string $notes;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: false)]private readonly string $serial;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var boolean
|
|
|
|
*/
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:10:57 -05:00
|
|
|
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: true)]
|
2017-11-30 15:06:13 -05:00
|
|
|
private $purchasePrice;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-02-17 15:48:16 -05:00
|
|
|
#[ORM\Column(name: 'battery_type', type: 'string', nullable: true)]private readonly ?string $batteryType;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* @var boolean
|
|
|
|
*/
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* Get id
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getId(): int
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set type
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get type
|
|
|
|
*
|
2018-02-14 15:08:03 -05:00
|
|
|
* @return CameraType
|
2017-11-30 15:06:13 -05:00
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getType(): ?CameraType
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set brand
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get brand
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getBrand(): ?string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->brand;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set mount
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get mount
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getMount(): ?string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->mount;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set model
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get model
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getModel(): ?string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->model;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set isDigital
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get isDigital
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getIsDigital(): ?bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->isDigital;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set cropFactor
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get cropFactor
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getCropFactor(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->cropFactor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set isWorking
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get isWorking
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getIsWorking(): ?bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->isWorking;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set notes
|
|
|
|
*
|
|
|
|
* @param string $notes
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setNotes($notes): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->notes = $notes;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get notes
|
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set serial
|
|
|
|
*
|
|
|
|
* @param string $serial
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setSerial($serial): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->serial = $serial;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get serial
|
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set formerlyOwned
|
|
|
|
*
|
|
|
|
* @param boolean $formerlyOwned
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setFormerlyOwned($formerlyOwned): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->formerlyOwned = $formerlyOwned;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get formerlyOwned
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getFormerlyOwned(): ?bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->formerlyOwned;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set batteryType
|
|
|
|
*
|
|
|
|
* @param string $batteryType
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setBatteryType($batteryType): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->batteryType = $batteryType;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get batteryType
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getBatteryType(): ?string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->batteryType;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set filmFormat
|
|
|
|
*
|
|
|
|
* @param string $filmFormat
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setFilmFormat($filmFormat): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->filmFormat = $filmFormat;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get filmFormat
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getFilmFormat(): string
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->filmFormat;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set received
|
|
|
|
*
|
|
|
|
* @param boolean $received
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function setReceived($received): self
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
$this->received = $received;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get received
|
|
|
|
*/
|
2018-02-14 15:08:03 -05:00
|
|
|
public function getReceived(): bool
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
|
|
|
return $this->received;
|
|
|
|
}
|
|
|
|
}
|