Remove sequencegenerator annotations from entities

This commit is contained in:
Timothy Warren 2018-01-03 16:41:56 -05:00
parent d8da3177e8
commit 9c6c44f140
7 changed files with 38 additions and 13 deletions

View File

@ -18,7 +18,6 @@ class BatteryType
* @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

@ -18,7 +18,6 @@ class CameraType
* @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;
@ -29,13 +28,20 @@ class CameraType
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* Value for serialization
*
* @return string
*/
public function __toString()
public function __toString(): string
{
return $this->type;
}
@ -46,7 +52,7 @@ class CameraType
*
* @return integer
*/
public function getId()
public function getId(): int
{
return $this->id;
}
@ -58,20 +64,44 @@ class CameraType
*
* @return CameraType
*/
public function setType($type)
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
/**
* Set description
*
* @param string $description
*
* @return CameraType
*/
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
/**
* Get type
*
* @return string
*/
public function getType()
public function getType(): string
{
return $this->type;
}
/**
* Get description
*
* @return string
*/
public function getDescription(): ?string
{
return $this->description;
}
}

View File

@ -20,7 +20,6 @@ class Flash
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="camera.flash_id_seq", allocationSize=1, initialValue=1)
*/
private $id;

View File

@ -19,8 +19,7 @@ class Lenses
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="camera.lenses_id_seq", allocationSize=1, initialValue=1)
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

View File

@ -20,7 +20,6 @@ class PreviouslyOwnedFlash
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_flash_id_seq", allocationSize=1, initialValue=1)
*/
private $id;

View File

@ -19,7 +19,6 @@ class PreviouslyOwnedLenses
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_lenses_id_seq", allocationSize=1, initialValue=1)
*/
private $id;

View File

@ -9,9 +9,9 @@ trait PurchasePriceTrait
*
* @param string $purchasePrice
*
* @return Camera
* @return self
*/
public function setPurchasePrice($purchasePrice)
public function setPurchasePrice($purchasePrice): self
{
$this->purchasePrice = $purchasePrice;