Split Camera, Lens, and Flash fields into traits so the PreviouslyOwned versions can use the same table structure

This commit is contained in:
Timothy Warren 2017-11-20 13:22:21 -05:00
parent 4a9c5210c5
commit dcfbafe983
14 changed files with 1567 additions and 3047 deletions

View File

@ -1,21 +1,22 @@
{% extends 'base.html.twig' %}
{% extends 'form.html.twig' %}
{% block body %}
<h1>Previouslyownedflash edit</h1>
{% block form %}
<h2>Edit Previously Owned Flash</h2>
<div class="callout">
<ul>
<li>
<a href="{{ path('previously-owned-flash_index') }}">Back to the list</a>
</li>
</ul>
</div>
<div class="primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
<button type="submit" class="button">Edit</button>
{{ form_end(edit_form) }}
</div>
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
<input type="submit" value="Edit" />
{{ form_end(edit_form) }}
<ul>
<li>
<a href="{{ path('previously-owned-flash_index') }}">Back to the list</a>
</li>
<li>
{{ form_start(delete_form) }}
<input type="submit" value="Delete">
{{ form_end(delete_form) }}
</li>
</ul>
{% endblock %}

View File

@ -1,16 +0,0 @@
{% extends 'base.html.twig' %}
{% block body %}
<h1>Previouslyownedflash creation</h1>
{{ form_start(form) }}
{{ form_widget(form) }}
<input type="submit" value="Create" />
{{ form_end(form) }}
<ul>
<li>
<a href="{{ path('previously-owned-flash_index') }}">Back to the list</a>
</li>
</ul>
{% endblock %}

View File

@ -1,80 +1,77 @@
{% extends 'base.html.twig' %}
{% extends 'form.html.twig' %}
{% block body %}
<h1>Previouslyownedflash</h1>
{% block form %}
<h2>Previously Owned Flash</h2>
<div class="callout">
<ul>
<li>
<a href="{{ path('previously-owned-flash_index') }}">Back to the list</a>
</li>
<li>
<a href="{{ path('previously-owned-flash_edit', { 'id': previouslyOwnedFlash.id }) }}">Edit</a>
</li>
</ul>
</div>
<div class="large primary callout">
<table>
<tbody>
<tr>
<th>Id</th>
<td>{{ previouslyOwnedFlash.id }}</td>
</tr>
<tr>
<th>Brand</th>
<td>{{ previouslyOwnedFlash.brand }}</td>
</tr>
<tr>
<th>Model</th>
<td>{{ previouslyOwnedFlash.model }}</td>
</tr>
<tr>
<th>Is Auto Flash?</th>
<td>{% if previouslyOwnedFlash.isAutoFlash %}Yes{% else %}No{% endif %}</td>
</tr>
<tr>
<th>Is TTL?</th>
<td>{% if previouslyOwnedFlash.isTtl %}Yes{% else %}No{% endif %}</td>
</tr>
<tr>
<th>TTL Type?</th>
<td>{{ previouslyOwnedFlash.ttlType }}</td>
</tr>
<tr>
<th>Is P-TTL?</th>
<td>{% if previouslyOwnedFlash.isPTtl %}Yes{% else %}No{% endif %}</td>
</tr>
<tr>
<th>P-TTL Type</th>
<td>{{ previouslyOwnedFlash.pTtlType }}</td>
</tr>
<tr>
<th>Guide Number</th>
<td>{{ previouslyOwnedFlash.guideNumber }}</td>
</tr>
<tr>
<th>Purchase Price</th>
<td>{{ previouslyOwnedFlash.purchasePrice }}</td>
</tr>
<tr>
<th>Batteries</th>
<td>{{ previouslyOwnedFlash.batteries }}</td>
</tr>
<tr>
<th>Notes</th>
<td>{{ previouslyOwnedFlash.notes }}</td>
</tr>
<tr>
<th>Serial</th>
<td>{{ previouslyOwnedFlash.serial }}</td>
</tr>
</tbody>
</table>
</div>
<table>
<tbody>
<tr>
<th>Id</th>
<td>{{ previouslyOwnedFlash.id }}</td>
</tr>
<tr>
<th>Brand</th>
<td>{{ previouslyOwnedFlash.brand }}</td>
</tr>
<tr>
<th>Model</th>
<td>{{ previouslyOwnedFlash.model }}</td>
</tr>
<tr>
<th>Isautoflash</th>
<td>{% if previouslyOwnedFlash.isAutoFlash %}Yes{% else %}No{% endif %}</td>
</tr>
<tr>
<th>Isttl</th>
<td>{% if previouslyOwnedFlash.isTtl %}Yes{% else %}No{% endif %}</td>
</tr>
<tr>
<th>Ttltype</th>
<td>{{ previouslyOwnedFlash.ttlType }}</td>
</tr>
<tr>
<th>Ispttl</th>
<td>{% if previouslyOwnedFlash.isPTtl %}Yes{% else %}No{% endif %}</td>
</tr>
<tr>
<th>Pttltype</th>
<td>{{ previouslyOwnedFlash.pTtlType }}</td>
</tr>
<tr>
<th>Guidenumber</th>
<td>{{ previouslyOwnedFlash.guideNumber }}</td>
</tr>
<tr>
<th>Purchaseprice</th>
<td>{{ previouslyOwnedFlash.purchasePrice }}</td>
</tr>
<tr>
<th>Batteries</th>
<td>{{ previouslyOwnedFlash.batteries }}</td>
</tr>
<tr>
<th>Notes</th>
<td>{{ previouslyOwnedFlash.notes }}</td>
</tr>
<tr>
<th>Serial</th>
<td>{{ previouslyOwnedFlash.serial }}</td>
</tr>
<tr>
<th>Formerlyowned</th>
<td>{% if previouslyOwnedFlash.formerlyOwned %}Yes{% else %}No{% endif %}</td>
</tr>
</tbody>
</table>
<ul>
<li>
<a href="{{ path('previously-owned-flash_index') }}">Back to the list</a>
</li>
<li>
<a href="{{ path('previously-owned-flash_edit', { 'id': previouslyOwnedFlash.id }) }}">Edit</a>
</li>
<li>
{{ form_start(delete_form) }}
<input type="submit" value="Delete">
{{ form_end(delete_form) }}
</li>
</ul>
{% endblock %}

View File

@ -66,11 +66,8 @@ class PreviouslyOwnedFlashController extends Controller
*/
public function showAction(PreviouslyOwnedFlash $previouslyOwnedFlash)
{
$deleteForm = $this->createDeleteForm($previouslyOwnedFlash);
return $this->render('previouslyownedflash/show.html.twig', array(
'previouslyOwnedFlash' => $previouslyOwnedFlash,
'delete_form' => $deleteForm->createView(),
'previouslyOwnedFlash' => $previouslyOwnedFlash
));
}
@ -82,7 +79,6 @@ class PreviouslyOwnedFlashController extends Controller
*/
public function editAction(Request $request, PreviouslyOwnedFlash $previouslyOwnedFlash)
{
$deleteForm = $this->createDeleteForm($previouslyOwnedFlash);
$editForm = $this->createForm('CameraBundle\Form\PreviouslyOwnedFlashType', $previouslyOwnedFlash);
$editForm->handleRequest($request);
@ -95,43 +91,6 @@ class PreviouslyOwnedFlashController extends Controller
return $this->render('previouslyownedflash/edit.html.twig', array(
'previouslyOwnedFlash' => $previouslyOwnedFlash,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Deletes a previouslyOwnedFlash entity.
*
* @Route("/{id}", name="previously-owned-flash_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $request, PreviouslyOwnedFlash $previouslyOwnedFlash)
{
$form = $this->createDeleteForm($previouslyOwnedFlash);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->remove($previouslyOwnedFlash);
$em->flush();
}
return $this->redirectToRoute('previously-owned-flash_index');
}
/**
* Creates a form to delete a previouslyOwnedFlash entity.
*
* @param PreviouslyOwnedFlash $previouslyOwnedFlash The previouslyOwnedFlash entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm(PreviouslyOwnedFlash $previouslyOwnedFlash)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('previously-owned-flash_delete', array('id' => $previouslyOwnedFlash->getId())))
->setMethod('DELETE')
->getForm()
;
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace CameraBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Battery Type
*
* @ORM\Table(name="battery_type", schema="camera")
* @ORM\Entity
*/
class BatteryType
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="camera.camera_type_id_seq", allocationSize=1, initialValue=1)
*/
private $id;
}

View File

@ -14,7 +14,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class Camera
{
use PurchasePriceTrait;
use CameraTrait;
/**
* @var integer
@ -26,426 +26,4 @@ class Camera
*/
private $id;
/**
* @var \CameraType
*
* @ORM\ManyToOne(targetEntity="CameraType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
* })
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=32, nullable=false)
*/
private $mount;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=255, nullable=false)
*/
private $model;
/**
* @var boolean
*
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
*/
private $isDigital;
/**
* @var string
*
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
*/
private $cropFactor = '1.0';
/**
* @var boolean
*
* @ORM\Column(name="is_working", type="boolean", nullable=false)
*/
private $isWorking;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
*/
private $serial;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
*/
private $formerlyOwned = false;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="battery_type", type="string", nullable=true)
*/
private $batteryType;
/**
* @var string
*
* @ORM\Column(name="film_format", type="string", nullable=true)
*/
private $filmFormat = '135';
/**
* @var boolean
*
* @ORM\Column(name="received", type="boolean", nullable=true)
*/
private $received = false;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set type
*
* @param \CameraBundle\Entity\CameraType $type
*
* @return Camera
*/
public function setType(\CameraBundle\Entity\CameraType $type = null)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return \CameraBundle\Entity\CameraType
*/
public function getType()
{
return $this->type;
}
/**
* Set brand
*
* @param string $brand
*
* @return Camera
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set mount
*
* @param string $mount
*
* @return Camera
*/
public function setMount($mount)
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount()
{
return $this->mount;
}
/**
* Set model
*
* @param string $model
*
* @return Camera
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set isDigital
*
* @param boolean $isDigital
*
* @return Camera
*/
public function setIsDigital($isDigital)
{
$this->isDigital = $isDigital;
return $this;
}
/**
* Get isDigital
*
* @return boolean
*/
public function getIsDigital()
{
return $this->isDigital;
}
/**
* Set cropFactor
*
* @param string $cropFactor
*
* @return Camera
*/
public function setCropFactor($cropFactor)
{
$this->cropFactor = $cropFactor;
return $this;
}
/**
* Get cropFactor
*
* @return string
*/
public function getCropFactor()
{
return $this->cropFactor;
}
/**
* Set isWorking
*
* @param boolean $isWorking
*
* @return Camera
*/
public function setIsWorking($isWorking)
{
$this->isWorking = $isWorking;
return $this;
}
/**
* Get isWorking
*
* @return boolean
*/
public function getIsWorking()
{
return $this->isWorking;
}
/**
* Set notes
*
* @param string $notes
*
* @return Camera
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set serial
*
* @param string $serial
*
* @return Camera
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Camera
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
/**
* Set batteryType
*
* @param string $batteryType
*
* @return Camera
*/
public function setBatteryType($batteryType)
{
$this->batteryType = $batteryType;
return $this;
}
/**
* Get batteryType
*
* @return string
*/
public function getBatteryType()
{
return $this->batteryType;
}
/**
* Set filmFormat
*
* @param string $filmFormat
*
* @return Camera
*/
public function setFilmFormat($filmFormat)
{
$this->filmFormat = $filmFormat;
return $this;
}
/**
* Get filmFormat
*
* @return string
*/
public function getFilmFormat()
{
return $this->filmFormat;
}
/**
* Set received
*
* @param boolean $received
*
* @return Camera
*/
public function setReceived($received)
{
$this->received = $received;
return $this;
}
/**
* Get received
*
* @return boolean
*/
public function getReceived()
{
return $this->received;
}
}

View File

@ -0,0 +1,431 @@
<?php
namespace CameraBundle\Entity;
trait CameraTrait {
use PurchasePriceTrait;
/**
* @var \CameraType
*
* @ORM\ManyToOne(targetEntity="CameraType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
* })
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=32, nullable=false)
*/
private $mount;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=255, nullable=false)
*/
private $model;
/**
* @var boolean
*
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
*/
private $isDigital;
/**
* @var string
*
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
*/
private $cropFactor = '1.0';
/**
* @var boolean
*
* @ORM\Column(name="is_working", type="boolean", nullable=false)
*/
private $isWorking;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
*/
private $serial;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
*/
private $formerlyOwned = false;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="battery_type", type="string", nullable=true)
*/
private $batteryType;
/**
* @var string
*
* @ORM\Column(name="film_format", type="string", nullable=true)
*/
private $filmFormat = '135';
/**
* @var boolean
*
* @ORM\Column(name="received", type="boolean", nullable=true)
*/
private $received = false;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set type
*
* @param \CameraBundle\Entity\CameraType $type
*
* @return Camera
*/
public function setType(\CameraBundle\Entity\CameraType $type = null)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return \CameraBundle\Entity\CameraType
*/
public function getType()
{
return $this->type;
}
/**
* Set brand
*
* @param string $brand
*
* @return Camera
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set mount
*
* @param string $mount
*
* @return Camera
*/
public function setMount($mount)
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount()
{
return $this->mount;
}
/**
* Set model
*
* @param string $model
*
* @return Camera
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set isDigital
*
* @param boolean $isDigital
*
* @return Camera
*/
public function setIsDigital($isDigital)
{
$this->isDigital = $isDigital;
return $this;
}
/**
* Get isDigital
*
* @return boolean
*/
public function getIsDigital()
{
return $this->isDigital;
}
/**
* Set cropFactor
*
* @param string $cropFactor
*
* @return Camera
*/
public function setCropFactor($cropFactor)
{
$this->cropFactor = $cropFactor;
return $this;
}
/**
* Get cropFactor
*
* @return string
*/
public function getCropFactor()
{
return $this->cropFactor;
}
/**
* Set isWorking
*
* @param boolean $isWorking
*
* @return Camera
*/
public function setIsWorking($isWorking)
{
$this->isWorking = $isWorking;
return $this;
}
/**
* Get isWorking
*
* @return boolean
*/
public function getIsWorking()
{
return $this->isWorking;
}
/**
* Set notes
*
* @param string $notes
*
* @return Camera
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set serial
*
* @param string $serial
*
* @return Camera
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Camera
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
/**
* Set batteryType
*
* @param string $batteryType
*
* @return Camera
*/
public function setBatteryType($batteryType)
{
$this->batteryType = $batteryType;
return $this;
}
/**
* Get batteryType
*
* @return string
*/
public function getBatteryType()
{
return $this->batteryType;
}
/**
* Set filmFormat
*
* @param string $filmFormat
*
* @return Camera
*/
public function setFilmFormat($filmFormat)
{
$this->filmFormat = $filmFormat;
return $this;
}
/**
* Get filmFormat
*
* @return string
*/
public function getFilmFormat()
{
return $this->filmFormat;
}
/**
* Set received
*
* @param boolean $received
*
* @return Camera
*/
public function setReceived($received)
{
$this->received = $received;
return $this;
}
/**
* Get received
*
* @return boolean
*/
public function getReceived()
{
return $this->received;
}
}

View File

@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class Flash
{
use PurchasePriceTrait;
use FlashTrait;
/**
* @var integer
@ -24,394 +24,4 @@ class Flash
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="model", type="string", nullable=false)
*/
private $model;
/**
* @var boolean
*
* @ORM\Column(name="is_auto_flash", type="boolean", nullable=false)
*/
private $isAutoFlash = false;
/**
* @var boolean
*
* @ORM\Column(name="is_ttl", type="boolean", nullable=false)
*/
private $isTtl = false;
/**
* @var string
*
* @ORM\Column(name="ttl_type", type="string", nullable=false)
*/
private $ttlType = 'N / A';
/**
* @var boolean
*
* @ORM\Column(name="is_p_ttl", type="boolean", nullable=false)
*/
private $isPTtl = false;
/**
* @var string
*
* @ORM\Column(name="p_ttl_type", type="string", nullable=false)
*/
private $pTtlType = 'N / A';
/**
* @var string
*
* @ORM\Column(name="guide_number", type="string", nullable=true)
*/
private $guideNumber;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="batteries", type="string", nullable=false)
*/
private $batteries = '4x AA';
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", nullable=true)
*/
private $serial;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false, options={"default" : false})
*/
private $formerlyOwned = false;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return Flash
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set model
*
* @param string $model
*
* @return Flash
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set isAutoFlash
*
* @param boolean $isAutoFlash
*
* @return Flash
*/
public function setIsAutoFlash($isAutoFlash)
{
$this->isAutoFlash = $isAutoFlash;
return $this;
}
/**
* Get isAutoFlash
*
* @return boolean
*/
public function getIsAutoFlash()
{
return $this->isAutoFlash;
}
/**
* Set isTtl
*
* @param boolean $isTtl
*
* @return Flash
*/
public function setIsTtl($isTtl)
{
$this->isTtl = $isTtl;
return $this;
}
/**
* Get isTtl
*
* @return boolean
*/
public function getIsTtl()
{
return $this->isTtl;
}
/**
* Set ttlType
*
* @param string $ttlType
*
* @return Flash
*/
public function setTtlType($ttlType)
{
$this->ttlType = $ttlType;
return $this;
}
/**
* Get ttlType
*
* @return string
*/
public function getTtlType()
{
return $this->ttlType;
}
/**
* Set isPTtl
*
* @param boolean $isPTtl
*
* @return Flash
*/
public function setIsPTtl($isPTtl)
{
$this->isPTtl = $isPTtl;
return $this;
}
/**
* Get isPTtl
*
* @return boolean
*/
public function getIsPTtl()
{
return $this->isPTtl;
}
/**
* Set pTtlType
*
* @param string $pTtlType
*
* @return Flash
*/
public function setPTtlType($pTtlType)
{
$this->pTtlType = $pTtlType;
return $this;
}
/**
* Get pTtlType
*
* @return string
*/
public function getPTtlType()
{
return $this->pTtlType;
}
/**
* Set guideNumber
*
* @param string $guideNumber
*
* @return Flash
*/
public function setGuideNumber($guideNumber)
{
$this->guideNumber = $guideNumber;
return $this;
}
/**
* Get guideNumber
*
* @return string
*/
public function getGuideNumber()
{
return $this->guideNumber;
}
/**
* Set batteries
*
* @param string $batteries
*
* @return Flash
*/
public function setBatteries($batteries)
{
$this->batteries = $batteries;
return $this;
}
/**
* Get batteries
*
* @return string
*/
public function getBatteries()
{
return $this->batteries;
}
/**
* Set notes
*
* @param string $notes
*
* @return Flash
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set serial
*
* @param string $serial
*
* @return Flash
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Flash
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
}

View File

@ -0,0 +1,398 @@
<?php
namespace CameraBundle\Entity;
trait FlashTrait {
use PurchasePriceTrait;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="model", type="string", nullable=false)
*/
private $model;
/**
* @var boolean
*
* @ORM\Column(name="is_auto_flash", type="boolean", nullable=false)
*/
private $isAutoFlash = false;
/**
* @var boolean
*
* @ORM\Column(name="is_ttl", type="boolean", nullable=false)
*/
private $isTtl = false;
/**
* @var string
*
* @ORM\Column(name="ttl_type", type="string", nullable=false)
*/
private $ttlType = 'N / A';
/**
* @var boolean
*
* @ORM\Column(name="is_p_ttl", type="boolean", nullable=false)
*/
private $isPTtl = false;
/**
* @var string
*
* @ORM\Column(name="p_ttl_type", type="string", nullable=false)
*/
private $pTtlType = 'N / A';
/**
* @var string
*
* @ORM\Column(name="guide_number", type="string", nullable=true)
*/
private $guideNumber;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="batteries", type="string", nullable=false)
*/
private $batteries = '4x AA';
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", nullable=true)
*/
private $serial;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false, options={"default" : false})
*/
private $formerlyOwned = false;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return Flash
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set model
*
* @param string $model
*
* @return Flash
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set isAutoFlash
*
* @param boolean $isAutoFlash
*
* @return Flash
*/
public function setIsAutoFlash($isAutoFlash)
{
$this->isAutoFlash = $isAutoFlash;
return $this;
}
/**
* Get isAutoFlash
*
* @return boolean
*/
public function getIsAutoFlash()
{
return $this->isAutoFlash;
}
/**
* Set isTtl
*
* @param boolean $isTtl
*
* @return Flash
*/
public function setIsTtl($isTtl)
{
$this->isTtl = $isTtl;
return $this;
}
/**
* Get isTtl
*
* @return boolean
*/
public function getIsTtl()
{
return $this->isTtl;
}
/**
* Set ttlType
*
* @param string $ttlType
*
* @return Flash
*/
public function setTtlType($ttlType)
{
$this->ttlType = $ttlType;
return $this;
}
/**
* Get ttlType
*
* @return string
*/
public function getTtlType()
{
return $this->ttlType;
}
/**
* Set isPTtl
*
* @param boolean $isPTtl
*
* @return Flash
*/
public function setIsPTtl($isPTtl)
{
$this->isPTtl = $isPTtl;
return $this;
}
/**
* Get isPTtl
*
* @return boolean
*/
public function getIsPTtl()
{
return $this->isPTtl;
}
/**
* Set pTtlType
*
* @param string $pTtlType
*
* @return Flash
*/
public function setPTtlType($pTtlType)
{
$this->pTtlType = $pTtlType;
return $this;
}
/**
* Get pTtlType
*
* @return string
*/
public function getPTtlType()
{
return $this->pTtlType;
}
/**
* Set guideNumber
*
* @param string $guideNumber
*
* @return Flash
*/
public function setGuideNumber($guideNumber)
{
$this->guideNumber = $guideNumber;
return $this;
}
/**
* Get guideNumber
*
* @return string
*/
public function getGuideNumber()
{
return $this->guideNumber;
}
/**
* Set batteries
*
* @param string $batteries
*
* @return Flash
*/
public function setBatteries($batteries)
{
$this->batteries = $batteries;
return $this;
}
/**
* Get batteries
*
* @return string
*/
public function getBatteries()
{
return $this->batteries;
}
/**
* Set notes
*
* @param string $notes
*
* @return Flash
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set serial
*
* @param string $serial
*
* @return Flash
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Flash
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
}

View File

@ -0,0 +1,615 @@
<?php
namespace CameraBundle\Entity;
trait LensTrait {
use PurchasePriceTrait;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
*/
private $coatings;
/**
* @var string
*
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
*/
private $productLine;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=64, nullable=true)
*/
private $model;
/**
* @var string
*
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
*/
private $minFStop;
/**
* @var float
*
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
*/
private $maxFStop;
/**
* @var integer
*
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
*/
private $minFocalLength;
/**
* @var integer
*
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
*/
private $maxFocalLength;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
*/
private $serial;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
*/
private $mount;
/**
* @var boolean
*
* @ORM\Column(name="received", type="boolean", nullable=false)
*/
private $received = false;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
*/
private $formerlyOwned = false;
/**
* @var string
*
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private $frontFilterSize;
/**
* @var string
*
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private $rearFilterSize;
/**
* @var boolean
*
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
*/
private $isTeleconverter = false;
/**
* @var integer
*
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
*/
private $designElements;
/**
* @var integer
*
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
*/
private $designGroups;
/**
* @var integer
*
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
*/
private $apertureBlades;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return Lenses
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set coatings
*
* @param string $coatings
*
* @return Lenses
*/
public function setCoatings($coatings)
{
$this->coatings = $coatings;
return $this;
}
/**
* Get coatings
*
* @return string
*/
public function getCoatings()
{
return $this->coatings;
}
/**
* Set productLine
*
* @param string $productLine
*
* @return Lenses
*/
public function setProductLine($productLine)
{
$this->productLine = $productLine;
return $this;
}
/**
* Get productLine
*
* @return string
*/
public function getProductLine()
{
return $this->productLine;
}
/**
* Set model
*
* @param string $model
*
* @return Lenses
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set minFStop
*
* @param string $minFStop
*
* @return Lenses
*/
public function setMinFStop($minFStop)
{
$this->minFStop = $minFStop;
return $this;
}
/**
* Get minFStop
*
* @return string
*/
public function getMinFStop()
{
return $this->minFStop;
}
/**
* Set maxFStop
*
* @param float $maxFStop
*
* @return Lenses
*/
public function setMaxFStop($maxFStop)
{
$this->maxFStop = $maxFStop;
return $this;
}
/**
* Get maxFStop
*
* @return float
*/
public function getMaxFStop()
{
return $this->maxFStop;
}
/**
* Set minFocalLength
*
* @param integer $minFocalLength
*
* @return Lenses
*/
public function setMinFocalLength($minFocalLength)
{
$this->minFocalLength = $minFocalLength;
return $this;
}
/**
* Get minFocalLength
*
* @return integer
*/
public function getMinFocalLength()
{
return $this->minFocalLength;
}
/**
* Set maxFocalLength
*
* @param integer $maxFocalLength
*
* @return Lenses
*/
public function setMaxFocalLength($maxFocalLength)
{
$this->maxFocalLength = $maxFocalLength;
return $this;
}
/**
* Get maxFocalLength
*
* @return integer
*/
public function getMaxFocalLength()
{
return $this->maxFocalLength;
}
/**
* Set serial
*
* @param string $serial
*
* @return Lenses
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set notes
*
* @param string $notes
*
* @return Lenses
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set mount
*
* @param string $mount
*
* @return Lenses
*/
public function setMount($mount)
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount()
{
return $this->mount;
}
/**
* Set received
*
* @param boolean $received
*
* @return Lenses
*/
public function setReceived($received)
{
$this->received = $received;
return $this;
}
/**
* Get received
*
* @return boolean
*/
public function getReceived()
{
return $this->received;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Lenses
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
/**
* Set frontFilterSize
*
* @param string $frontFilterSize
*
* @return Lenses
*/
public function setFrontFilterSize($frontFilterSize)
{
$this->frontFilterSize = $frontFilterSize;
return $this;
}
/**
* Get frontFilterSize
*
* @return string
*/
public function getFrontFilterSize()
{
return $this->frontFilterSize;
}
/**
* Set rearFilterSize
*
* @param string $rearFilterSize
*
* @return Lenses
*/
public function setRearFilterSize($rearFilterSize)
{
$this->rearFilterSize = $rearFilterSize;
return $this;
}
/**
* Get rearFilterSize
*
* @return string
*/
public function getRearFilterSize()
{
return $this->rearFilterSize;
}
/**
* Set isTeleconverter
*
* @param boolean $isTeleconverter
*
* @return Lenses
*/
public function setIsTeleconverter($isTeleconverter)
{
$this->isTeleconverter = $isTeleconverter;
return $this;
}
/**
* Get isTeleconverter
*
* @return boolean
*/
public function getIsTeleconverter()
{
return $this->isTeleconverter;
}
/**
* Set designElements
*
* @param integer $designElements
*
* @return Lenses
*/
public function setDesignElements($designElements)
{
$this->designElements = $designElements;
return $this;
}
/**
* Get designElements
*
* @return integer
*/
public function getDesignElements()
{
return $this->designElements;
}
/**
* Set designGroups
*
* @param integer $designGroups
*
* @return Lenses
*/
public function setDesignGroups($designGroups)
{
$this->designGroups = $designGroups;
return $this;
}
/**
* Get designGroups
*
* @return integer
*/
public function getDesignGroups()
{
return $this->designGroups;
}
/**
* Set apertureBlades
*
* @param integer $apertureBlades
*
* @return Lenses
*/
public function setApertureBlades($apertureBlades)
{
$this->apertureBlades = $apertureBlades;
return $this;
}
/**
* Get apertureBlades
*
* @return integer
*/
public function getApertureBlades()
{
return $this->apertureBlades;
}
}

View File

@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class Lenses
{
use PurchasePriceTrait;
use LensTrait;
/**
* @var integer
@ -23,612 +23,4 @@ class Lenses
* @ORM\SequenceGenerator(sequenceName="camera.lenses_id_seq", allocationSize=1, initialValue=1)
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
*/
private $coatings;
/**
* @var string
*
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
*/
private $productLine;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=64, nullable=true)
*/
private $model;
/**
* @var string
*
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
*/
private $minFStop;
/**
* @var float
*
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
*/
private $maxFStop;
/**
* @var integer
*
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
*/
private $minFocalLength;
/**
* @var integer
*
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
*/
private $maxFocalLength;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
*/
private $serial;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
*/
private $mount;
/**
* @var boolean
*
* @ORM\Column(name="received", type="boolean", nullable=false)
*/
private $received = false;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
*/
private $formerlyOwned = false;
/**
* @var string
*
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private $frontFilterSize;
/**
* @var string
*
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private $rearFilterSize;
/**
* @var boolean
*
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
*/
private $isTeleconverter = false;
/**
* @var integer
*
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
*/
private $designElements;
/**
* @var integer
*
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
*/
private $designGroups;
/**
* @var integer
*
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
*/
private $apertureBlades;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return Lenses
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set coatings
*
* @param string $coatings
*
* @return Lenses
*/
public function setCoatings($coatings)
{
$this->coatings = $coatings;
return $this;
}
/**
* Get coatings
*
* @return string
*/
public function getCoatings()
{
return $this->coatings;
}
/**
* Set productLine
*
* @param string $productLine
*
* @return Lenses
*/
public function setProductLine($productLine)
{
$this->productLine = $productLine;
return $this;
}
/**
* Get productLine
*
* @return string
*/
public function getProductLine()
{
return $this->productLine;
}
/**
* Set model
*
* @param string $model
*
* @return Lenses
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set minFStop
*
* @param string $minFStop
*
* @return Lenses
*/
public function setMinFStop($minFStop)
{
$this->minFStop = $minFStop;
return $this;
}
/**
* Get minFStop
*
* @return string
*/
public function getMinFStop()
{
return $this->minFStop;
}
/**
* Set maxFStop
*
* @param float $maxFStop
*
* @return Lenses
*/
public function setMaxFStop($maxFStop)
{
$this->maxFStop = $maxFStop;
return $this;
}
/**
* Get maxFStop
*
* @return float
*/
public function getMaxFStop()
{
return $this->maxFStop;
}
/**
* Set minFocalLength
*
* @param integer $minFocalLength
*
* @return Lenses
*/
public function setMinFocalLength($minFocalLength)
{
$this->minFocalLength = $minFocalLength;
return $this;
}
/**
* Get minFocalLength
*
* @return integer
*/
public function getMinFocalLength()
{
return $this->minFocalLength;
}
/**
* Set maxFocalLength
*
* @param integer $maxFocalLength
*
* @return Lenses
*/
public function setMaxFocalLength($maxFocalLength)
{
$this->maxFocalLength = $maxFocalLength;
return $this;
}
/**
* Get maxFocalLength
*
* @return integer
*/
public function getMaxFocalLength()
{
return $this->maxFocalLength;
}
/**
* Set serial
*
* @param string $serial
*
* @return Lenses
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set notes
*
* @param string $notes
*
* @return Lenses
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set mount
*
* @param string $mount
*
* @return Lenses
*/
public function setMount($mount)
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount()
{
return $this->mount;
}
/**
* Set received
*
* @param boolean $received
*
* @return Lenses
*/
public function setReceived($received)
{
$this->received = $received;
return $this;
}
/**
* Get received
*
* @return boolean
*/
public function getReceived()
{
return $this->received;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Lenses
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
/**
* Set frontFilterSize
*
* @param string $frontFilterSize
*
* @return Lenses
*/
public function setFrontFilterSize($frontFilterSize)
{
$this->frontFilterSize = $frontFilterSize;
return $this;
}
/**
* Get frontFilterSize
*
* @return string
*/
public function getFrontFilterSize()
{
return $this->frontFilterSize;
}
/**
* Set rearFilterSize
*
* @param string $rearFilterSize
*
* @return Lenses
*/
public function setRearFilterSize($rearFilterSize)
{
$this->rearFilterSize = $rearFilterSize;
return $this;
}
/**
* Get rearFilterSize
*
* @return string
*/
public function getRearFilterSize()
{
return $this->rearFilterSize;
}
/**
* Set isTeleconverter
*
* @param boolean $isTeleconverter
*
* @return Lenses
*/
public function setIsTeleconverter($isTeleconverter)
{
$this->isTeleconverter = $isTeleconverter;
return $this;
}
/**
* Get isTeleconverter
*
* @return boolean
*/
public function getIsTeleconverter()
{
return $this->isTeleconverter;
}
/**
* Set designElements
*
* @param integer $designElements
*
* @return Lenses
*/
public function setDesignElements($designElements)
{
$this->designElements = $designElements;
return $this;
}
/**
* Get designElements
*
* @return integer
*/
public function getDesignElements()
{
return $this->designElements;
}
/**
* Set designGroups
*
* @param integer $designGroups
*
* @return Lenses
*/
public function setDesignGroups($designGroups)
{
$this->designGroups = $designGroups;
return $this;
}
/**
* Get designGroups
*
* @return integer
*/
public function getDesignGroups()
{
return $this->designGroups;
}
/**
* Set apertureBlades
*
* @param integer $apertureBlades
*
* @return Lenses
*/
public function setApertureBlades($apertureBlades)
{
$this->apertureBlades = $apertureBlades;
return $this;
}
/**
* Get apertureBlades
*
* @return integer
*/
public function getApertureBlades()
{
return $this->apertureBlades;
}
}

View File

@ -12,6 +12,8 @@ use Doctrine\ORM\Mapping as ORM;
*/
class PreviouslyOwnedCamera
{
use CameraTrait;
/**
* @var integer
*
@ -21,453 +23,4 @@ class PreviouslyOwnedCamera
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_camera_id_seq", allocationSize=1, initialValue=1)
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=32, nullable=false)
*/
private $mount;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=255, nullable=false)
*/
private $model;
/**
* @var boolean
*
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
*/
private $isDigital;
/**
* @var string
*
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
*/
private $cropFactor = '1.0';
/**
* @var boolean
*
* @ORM\Column(name="is_working", type="boolean", nullable=false)
*/
private $isWorking;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
*/
private $serial;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
*/
private $formerlyOwned = false;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="battery_type", type="string", nullable=true)
*/
private $batteryType;
/**
* @var string
*
* @ORM\Column(name="film_format", type="string", nullable=true)
*/
private $filmFormat = '135';
/**
* @var boolean
*
* @ORM\Column(name="received", type="boolean", nullable=true)
*/
private $received = true;
/**
* @var \Camera.cameraType
*
* @ORM\ManyToOne(targetEntity="CameraType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
* })
*/
private $type;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return PreviouslyOwnedCamera
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set mount
*
* @param string $mount
*
* @return PreviouslyOwnedCamera
*/
public function setMount($mount)
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount()
{
return $this->mount;
}
/**
* Set model
*
* @param string $model
*
* @return PreviouslyOwnedCamera
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set isDigital
*
* @param boolean $isDigital
*
* @return PreviouslyOwnedCamera
*/
public function setIsDigital($isDigital)
{
$this->isDigital = $isDigital;
return $this;
}
/**
* Get isDigital
*
* @return boolean
*/
public function getIsDigital()
{
return $this->isDigital;
}
/**
* Set cropFactor
*
* @param string $cropFactor
*
* @return PreviouslyOwnedCamera
*/
public function setCropFactor($cropFactor)
{
$this->cropFactor = $cropFactor;
return $this;
}
/**
* Get cropFactor
*
* @return string
*/
public function getCropFactor()
{
return $this->cropFactor;
}
/**
* Set isWorking
*
* @param boolean $isWorking
*
* @return PreviouslyOwnedCamera
*/
public function setIsWorking($isWorking)
{
$this->isWorking = $isWorking;
return $this;
}
/**
* Get isWorking
*
* @return boolean
*/
public function getIsWorking()
{
return $this->isWorking;
}
/**
* Set notes
*
* @param string $notes
*
* @return PreviouslyOwnedCamera
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set serial
*
* @param string $serial
*
* @return PreviouslyOwnedCamera
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return PreviouslyOwnedCamera
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
/**
* Set purchasePrice
*
* @param string $purchasePrice
*
* @return Camera
*/
public function setPurchasePrice($purchasePrice)
{
$this->purchasePrice = $purchasePrice ?? 0;
return $this;
}
/**
* Get purchasePrice
*
* @return string
*/
public function getPurchasePrice()
{
return (double) str_replace('$', '', (string)$this->purchasePrice) ?? 0;
}
/**
* Set batteryType
*
* @param string $batteryType
*
* @return PreviouslyOwnedCamera
*/
public function setBatteryType($batteryType)
{
$this->batteryType = $batteryType;
return $this;
}
/**
* Get batteryType
*
* @return string
*/
public function getBatteryType()
{
return $this->batteryType;
}
/**
* Set filmFormat
*
* @param string $filmFormat
*
* @return PreviouslyOwnedCamera
*/
public function setFilmFormat($filmFormat)
{
$this->filmFormat = $filmFormat;
return $this;
}
/**
* Get filmFormat
*
* @return string
*/
public function getFilmFormat()
{
return $this->filmFormat;
}
/**
* Set received
*
* @param boolean $received
*
* @return PreviouslyOwnedCamera
*/
public function setReceived($received)
{
$this->received = $received;
return $this;
}
/**
* Get received
*
* @return boolean
*/
public function getReceived()
{
return $this->received;
}
/**
* Set type
*
* @param \CameraBundle\Entity\CameraType $type
*
* @return PreviouslyOwnedCamera
*/
public function setType(\CameraBundle\Entity\CameraType $type = null)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return \CameraBundle\Entity\CameraType
*/
public function getType()
{
return $this->type;
}
}

View File

@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class PreviouslyOwnedFlash
{
use PurchasePriceTrait;
use FlashTrait;
/**
* @var integer
@ -23,395 +23,4 @@ class PreviouslyOwnedFlash
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_flash_id_seq", allocationSize=1, initialValue=1)
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="model", type="string", nullable=false)
*/
private $model;
/**
* @var boolean
*
* @ORM\Column(name="is_auto_flash", type="boolean", nullable=false)
*/
private $isAutoFlash = false;
/**
* @var boolean
*
* @ORM\Column(name="is_ttl", type="boolean", nullable=false)
*/
private $isTtl = false;
/**
* @var string
*
* @ORM\Column(name="ttl_type", type="string", nullable=false)
*/
private $ttlType = 'N / A';
/**
* @var boolean
*
* @ORM\Column(name="is_p_ttl", type="boolean", nullable=false)
*/
private $isPTtl = false;
/**
* @var string
*
* @ORM\Column(name="p_ttl_type", type="string", nullable=false)
*/
private $pTtlType = 'N / A';
/**
* @var string
*
* @ORM\Column(name="guide_number", type="string", nullable=true)
*/
private $guideNumber;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="batteries", type="string", nullable=false)
*/
private $batteries = '4x AA';
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", nullable=true)
*/
private $serial;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false, options={"default" : false})
*/
private $formerlyOwned = true;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return Flash
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set model
*
* @param string $model
*
* @return Flash
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set isAutoFlash
*
* @param boolean $isAutoFlash
*
* @return Flash
*/
public function setIsAutoFlash($isAutoFlash)
{
$this->isAutoFlash = $isAutoFlash;
return $this;
}
/**
* Get isAutoFlash
*
* @return boolean
*/
public function getIsAutoFlash()
{
return $this->isAutoFlash;
}
/**
* Set isTtl
*
* @param boolean $isTtl
*
* @return Flash
*/
public function setIsTtl($isTtl)
{
$this->isTtl = $isTtl;
return $this;
}
/**
* Get isTtl
*
* @return boolean
*/
public function getIsTtl()
{
return $this->isTtl;
}
/**
* Set ttlType
*
* @param string $ttlType
*
* @return Flash
*/
public function setTtlType($ttlType)
{
$this->ttlType = $ttlType;
return $this;
}
/**
* Get ttlType
*
* @return string
*/
public function getTtlType()
{
return $this->ttlType;
}
/**
* Set isPTtl
*
* @param boolean $isPTtl
*
* @return Flash
*/
public function setIsPTtl($isPTtl)
{
$this->isPTtl = $isPTtl;
return $this;
}
/**
* Get isPTtl
*
* @return boolean
*/
public function getIsPTtl()
{
return $this->isPTtl;
}
/**
* Set pTtlType
*
* @param string $pTtlType
*
* @return Flash
*/
public function setPTtlType($pTtlType)
{
$this->pTtlType = $pTtlType;
return $this;
}
/**
* Get pTtlType
*
* @return string
*/
public function getPTtlType()
{
return $this->pTtlType;
}
/**
* Set guideNumber
*
* @param string $guideNumber
*
* @return Flash
*/
public function setGuideNumber($guideNumber)
{
$this->guideNumber = $guideNumber;
return $this;
}
/**
* Get guideNumber
*
* @return string
*/
public function getGuideNumber()
{
return $this->guideNumber;
}
/**
* Set batteries
*
* @param string $batteries
*
* @return Flash
*/
public function setBatteries($batteries)
{
$this->batteries = $batteries;
return $this;
}
/**
* Get batteries
*
* @return string
*/
public function getBatteries()
{
return $this->batteries;
}
/**
* Set notes
*
* @param string $notes
*
* @return Flash
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set serial
*
* @param string $serial
*
* @return Flash
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return Flash
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
}

View File

@ -12,6 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class PreviouslyOwnedLenses
{
use LensTrait;
/**
* @var integer
*
@ -21,636 +22,4 @@ class PreviouslyOwnedLenses
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_lenses_id_seq", allocationSize=1, initialValue=1)
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
*/
private $coatings;
/**
* @var string
*
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
*/
private $productLine;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=64, nullable=true)
*/
private $model;
/**
* @var string
*
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
*/
private $minFStop;
/**
* @var float
*
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
*/
private $maxFStop;
/**
* @var integer
*
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
*/
private $minFocalLength;
/**
* @var integer
*
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
*/
private $maxFocalLength;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
*/
private $serial;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
*/
private $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
*/
private $mount;
/**
* @var boolean
*
* @ORM\Column(name="received", type="boolean", nullable=false)
*/
private $received = false;
/**
* @var boolean
*
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
*/
private $formerlyOwned = false;
/**
* @var string
*
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private $frontFilterSize;
/**
* @var string
*
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private $rearFilterSize;
/**
* @var boolean
*
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
*/
private $isTeleconverter = false;
/**
* @var integer
*
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
*/
private $designElements;
/**
* @var integer
*
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
*/
private $designGroups;
/**
* @var integer
*
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
*/
private $apertureBlades;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set brand
*
* @param string $brand
*
* @return PreviouslyOwnedLenses
*/
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
/**
* Get brand
*
* @return string
*/
public function getBrand()
{
return $this->brand;
}
/**
* Set coatings
*
* @param string $coatings
*
* @return PreviouslyOwnedLenses
*/
public function setCoatings($coatings)
{
$this->coatings = $coatings;
return $this;
}
/**
* Get coatings
*
* @return string
*/
public function getCoatings()
{
return $this->coatings;
}
/**
* Set productLine
*
* @param string $productLine
*
* @return PreviouslyOwnedLenses
*/
public function setProductLine($productLine)
{
$this->productLine = $productLine;
return $this;
}
/**
* Get productLine
*
* @return string
*/
public function getProductLine()
{
return $this->productLine;
}
/**
* Set model
*
* @param string $model
*
* @return PreviouslyOwnedLenses
*/
public function setModel($model)
{
$this->model = $model;
return $this;
}
/**
* Get model
*
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Set minFStop
*
* @param string $minFStop
*
* @return PreviouslyOwnedLenses
*/
public function setMinFStop($minFStop)
{
$this->minFStop = $minFStop;
return $this;
}
/**
* Get minFStop
*
* @return string
*/
public function getMinFStop()
{
return $this->minFStop;
}
/**
* Set maxFStop
*
* @param float $maxFStop
*
* @return PreviouslyOwnedLenses
*/
public function setMaxFStop($maxFStop)
{
$this->maxFStop = $maxFStop;
return $this;
}
/**
* Get maxFStop
*
* @return float
*/
public function getMaxFStop()
{
return $this->maxFStop;
}
/**
* Set minFocalLength
*
* @param integer $minFocalLength
*
* @return PreviouslyOwnedLenses
*/
public function setMinFocalLength($minFocalLength)
{
$this->minFocalLength = $minFocalLength;
return $this;
}
/**
* Get minFocalLength
*
* @return integer
*/
public function getMinFocalLength()
{
return $this->minFocalLength;
}
/**
* Set maxFocalLength
*
* @param integer $maxFocalLength
*
* @return PreviouslyOwnedLenses
*/
public function setMaxFocalLength($maxFocalLength)
{
$this->maxFocalLength = $maxFocalLength;
return $this;
}
/**
* Get maxFocalLength
*
* @return integer
*/
public function getMaxFocalLength()
{
return $this->maxFocalLength;
}
/**
* Set serial
*
* @param string $serial
*
* @return PreviouslyOwnedLenses
*/
public function setSerial($serial)
{
$this->serial = $serial;
return $this;
}
/**
* Get serial
*
* @return string
*/
public function getSerial()
{
return $this->serial;
}
/**
* Set purchasePrice
*
* @param string $purchasePrice
*
* @return Camera
*/
public function setPurchasePrice($purchasePrice)
{
$this->purchasePrice = $purchasePrice ?? 0;
return $this;
}
/**
* Get purchasePrice
*
* @return string
*/
public function getPurchasePrice()
{
return (double) str_replace('$', '', (string)$this->purchasePrice) ?? 0;
}
/**
* Set notes
*
* @param string $notes
*
* @return PreviouslyOwnedLenses
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
/**
* Set mount
*
* @param string $mount
*
* @return PreviouslyOwnedLenses
*/
public function setMount($mount)
{
$this->mount = $mount;
return $this;
}
/**
* Get mount
*
* @return string
*/
public function getMount()
{
return $this->mount;
}
/**
* Set received
*
* @param boolean $received
*
* @return PreviouslyOwnedLenses
*/
public function setReceived($received)
{
$this->received = $received;
return $this;
}
/**
* Get received
*
* @return boolean
*/
public function getReceived()
{
return $this->received;
}
/**
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return PreviouslyOwnedLenses
*/
public function setFormerlyOwned($formerlyOwned)
{
$this->formerlyOwned = $formerlyOwned;
return $this;
}
/**
* Get formerlyOwned
*
* @return boolean
*/
public function getFormerlyOwned()
{
return $this->formerlyOwned;
}
/**
* Set frontFilterSize
*
* @param string $frontFilterSize
*
* @return PreviouslyOwnedLenses
*/
public function setFrontFilterSize($frontFilterSize)
{
$this->frontFilterSize = $frontFilterSize;
return $this;
}
/**
* Get frontFilterSize
*
* @return string
*/
public function getFrontFilterSize()
{
return $this->frontFilterSize;
}
/**
* Set rearFilterSize
*
* @param string $rearFilterSize
*
* @return PreviouslyOwnedLenses
*/
public function setRearFilterSize($rearFilterSize)
{
$this->rearFilterSize = $rearFilterSize;
return $this;
}
/**
* Get rearFilterSize
*
* @return string
*/
public function getRearFilterSize()
{
return $this->rearFilterSize;
}
/**
* Set isTeleconverter
*
* @param boolean $isTeleconverter
*
* @return PreviouslyOwnedLenses
*/
public function setIsTeleconverter($isTeleconverter)
{
$this->isTeleconverter = $isTeleconverter;
return $this;
}
/**
* Get isTeleconverter
*
* @return boolean
*/
public function getIsTeleconverter()
{
return $this->isTeleconverter;
}
/**
* Set designElements
*
* @param integer $designElements
*
* @return PreviouslyOwnedLenses
*/
public function setDesignElements($designElements)
{
$this->designElements = $designElements;
return $this;
}
/**
* Get designElements
*
* @return integer
*/
public function getDesignElements()
{
return $this->designElements;
}
/**
* Set designGroups
*
* @param integer $designGroups
*
* @return PreviouslyOwnedLenses
*/
public function setDesignGroups($designGroups)
{
$this->designGroups = $designGroups;
return $this;
}
/**
* Get designGroups
*
* @return integer
*/
public function getDesignGroups()
{
return $this->designGroups;
}
/**
* Set apertureBlades
*
* @param integer $apertureBlades
*
* @return PreviouslyOwnedLenses
*/
public function setApertureBlades($apertureBlades)
{
$this->apertureBlades = $apertureBlades;
return $this;
}
/**
* Get apertureBlades
*
* @return integer
*/
public function getApertureBlades()
{
return $this->apertureBlades;
}
}