From dcfbafe983c55f6e27d93c77d2c1bc4f4cac9b8e Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Mon, 20 Nov 2017 13:22:21 -0500 Subject: [PATCH] Split Camera, Lens, and Flash fields into traits so the PreviouslyOwned versions can use the same table structure --- .../views/previouslyownedflash/edit.html.twig | 35 +- .../views/previouslyownedflash/new.html.twig | 16 - .../views/previouslyownedflash/show.html.twig | 149 ++--- .../PreviouslyOwnedFlashController.php | 43 +- src/CameraBundle/Entity/BatteryType.php | 24 + src/CameraBundle/Entity/Camera.php | 424 +----------- src/CameraBundle/Entity/CameraTrait.php | 431 ++++++++++++ src/CameraBundle/Entity/Flash.php | 392 +---------- src/CameraBundle/Entity/FlashTrait.php | 398 +++++++++++ src/CameraBundle/Entity/LensTrait.php | 615 +++++++++++++++++ src/CameraBundle/Entity/Lenses.php | 610 +---------------- .../Entity/PreviouslyOwnedCamera.php | 451 +------------ .../Entity/PreviouslyOwnedFlash.php | 393 +---------- .../Entity/PreviouslyOwnedLenses.php | 633 +----------------- 14 files changed, 1567 insertions(+), 3047 deletions(-) delete mode 100644 app/Resources/views/previouslyownedflash/new.html.twig create mode 100644 src/CameraBundle/Entity/BatteryType.php create mode 100644 src/CameraBundle/Entity/CameraTrait.php create mode 100644 src/CameraBundle/Entity/FlashTrait.php create mode 100644 src/CameraBundle/Entity/LensTrait.php diff --git a/app/Resources/views/previouslyownedflash/edit.html.twig b/app/Resources/views/previouslyownedflash/edit.html.twig index fd49bf1..fa27f45 100644 --- a/app/Resources/views/previouslyownedflash/edit.html.twig +++ b/app/Resources/views/previouslyownedflash/edit.html.twig @@ -1,21 +1,22 @@ -{% extends 'base.html.twig' %} +{% extends 'form.html.twig' %} -{% block body %} -

Previouslyownedflash edit

+{% block form %} +

Edit Previously Owned Flash

+ +
+ +
+ +
+ {{ form_start(edit_form) }} + {{ form_widget(edit_form) }} + + {{ form_end(edit_form) }} +
- {{ form_start(edit_form) }} - {{ form_widget(edit_form) }} - - {{ form_end(edit_form) }} - {% endblock %} diff --git a/app/Resources/views/previouslyownedflash/new.html.twig b/app/Resources/views/previouslyownedflash/new.html.twig deleted file mode 100644 index 019063a..0000000 --- a/app/Resources/views/previouslyownedflash/new.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block body %} -

Previouslyownedflash creation

- - {{ form_start(form) }} - {{ form_widget(form) }} - - {{ form_end(form) }} - - -{% endblock %} diff --git a/app/Resources/views/previouslyownedflash/show.html.twig b/app/Resources/views/previouslyownedflash/show.html.twig index 743d6ed..f7ea3a5 100644 --- a/app/Resources/views/previouslyownedflash/show.html.twig +++ b/app/Resources/views/previouslyownedflash/show.html.twig @@ -1,80 +1,77 @@ -{% extends 'base.html.twig' %} +{% extends 'form.html.twig' %} -{% block body %} -

Previouslyownedflash

+{% block form %} +

Previously Owned Flash

+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id{{ previouslyOwnedFlash.id }}
Brand{{ previouslyOwnedFlash.brand }}
Model{{ previouslyOwnedFlash.model }}
Is Auto Flash?{% if previouslyOwnedFlash.isAutoFlash %}Yes{% else %}No{% endif %}
Is TTL?{% if previouslyOwnedFlash.isTtl %}Yes{% else %}No{% endif %}
TTL Type?{{ previouslyOwnedFlash.ttlType }}
Is P-TTL?{% if previouslyOwnedFlash.isPTtl %}Yes{% else %}No{% endif %}
P-TTL Type{{ previouslyOwnedFlash.pTtlType }}
Guide Number{{ previouslyOwnedFlash.guideNumber }}
Purchase Price{{ previouslyOwnedFlash.purchasePrice }}
Batteries{{ previouslyOwnedFlash.batteries }}
Notes{{ previouslyOwnedFlash.notes }}
Serial{{ previouslyOwnedFlash.serial }}
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Id{{ previouslyOwnedFlash.id }}
Brand{{ previouslyOwnedFlash.brand }}
Model{{ previouslyOwnedFlash.model }}
Isautoflash{% if previouslyOwnedFlash.isAutoFlash %}Yes{% else %}No{% endif %}
Isttl{% if previouslyOwnedFlash.isTtl %}Yes{% else %}No{% endif %}
Ttltype{{ previouslyOwnedFlash.ttlType }}
Ispttl{% if previouslyOwnedFlash.isPTtl %}Yes{% else %}No{% endif %}
Pttltype{{ previouslyOwnedFlash.pTtlType }}
Guidenumber{{ previouslyOwnedFlash.guideNumber }}
Purchaseprice{{ previouslyOwnedFlash.purchasePrice }}
Batteries{{ previouslyOwnedFlash.batteries }}
Notes{{ previouslyOwnedFlash.notes }}
Serial{{ previouslyOwnedFlash.serial }}
Formerlyowned{% if previouslyOwnedFlash.formerlyOwned %}Yes{% else %}No{% endif %}
- {% endblock %} diff --git a/src/CameraBundle/Controller/PreviouslyOwnedFlashController.php b/src/CameraBundle/Controller/PreviouslyOwnedFlashController.php index 400fd52..064b667 100644 --- a/src/CameraBundle/Controller/PreviouslyOwnedFlashController.php +++ b/src/CameraBundle/Controller/PreviouslyOwnedFlashController.php @@ -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() - ; - } } diff --git a/src/CameraBundle/Entity/BatteryType.php b/src/CameraBundle/Entity/BatteryType.php new file mode 100644 index 0000000..063f99e --- /dev/null +++ b/src/CameraBundle/Entity/BatteryType.php @@ -0,0 +1,24 @@ +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; - } } diff --git a/src/CameraBundle/Entity/CameraTrait.php b/src/CameraBundle/Entity/CameraTrait.php new file mode 100644 index 0000000..707678f --- /dev/null +++ b/src/CameraBundle/Entity/CameraTrait.php @@ -0,0 +1,431 @@ +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; + } + +} \ No newline at end of file diff --git a/src/CameraBundle/Entity/Flash.php b/src/CameraBundle/Entity/Flash.php index 4dae87f..d507c2b 100644 --- a/src/CameraBundle/Entity/Flash.php +++ b/src/CameraBundle/Entity/Flash.php @@ -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; - } } diff --git a/src/CameraBundle/Entity/FlashTrait.php b/src/CameraBundle/Entity/FlashTrait.php new file mode 100644 index 0000000..80573c8 --- /dev/null +++ b/src/CameraBundle/Entity/FlashTrait.php @@ -0,0 +1,398 @@ +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; + } +} \ No newline at end of file diff --git a/src/CameraBundle/Entity/LensTrait.php b/src/CameraBundle/Entity/LensTrait.php new file mode 100644 index 0000000..0a810fa --- /dev/null +++ b/src/CameraBundle/Entity/LensTrait.php @@ -0,0 +1,615 @@ +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; + } +} \ No newline at end of file diff --git a/src/CameraBundle/Entity/Lenses.php b/src/CameraBundle/Entity/Lenses.php index a94b60b..745daa3 100644 --- a/src/CameraBundle/Entity/Lenses.php +++ b/src/CameraBundle/Entity/Lenses.php @@ -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; - } } diff --git a/src/CameraBundle/Entity/PreviouslyOwnedCamera.php b/src/CameraBundle/Entity/PreviouslyOwnedCamera.php index fc60588..19ef304 100644 --- a/src/CameraBundle/Entity/PreviouslyOwnedCamera.php +++ b/src/CameraBundle/Entity/PreviouslyOwnedCamera.php @@ -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; - } } diff --git a/src/CameraBundle/Entity/PreviouslyOwnedFlash.php b/src/CameraBundle/Entity/PreviouslyOwnedFlash.php index c8d10aa..5dffa60 100644 --- a/src/CameraBundle/Entity/PreviouslyOwnedFlash.php +++ b/src/CameraBundle/Entity/PreviouslyOwnedFlash.php @@ -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; - } } diff --git a/src/CameraBundle/Entity/PreviouslyOwnedLenses.php b/src/CameraBundle/Entity/PreviouslyOwnedLenses.php index b39fcec..7c0da39 100644 --- a/src/CameraBundle/Entity/PreviouslyOwnedLenses.php +++ b/src/CameraBundle/Entity/PreviouslyOwnedLenses.php @@ -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; - } }