StockItem.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. namespace References\Fixture\ORM;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use References\Fixture\ODM\MongoDB\Product;
  6. /**
  7. * @ORM\Entity
  8. */
  9. class StockItem
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\Column(type="integer")
  14. * @ORM\GeneratedValue(strategy="IDENTITY")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column
  19. */
  20. private $name;
  21. /**
  22. * @ORM\Column
  23. */
  24. private $sku;
  25. /**
  26. * @ORM\Column(type="integer")
  27. */
  28. private $quantity;
  29. /**
  30. * @Gedmo\ReferenceOne(type="document", class="References\Fixture\ODM\MongoDB\Product", inversedBy="stockItems", identifier="productId")
  31. */
  32. private $product;
  33. /**
  34. * @ORM\Column(type="string")
  35. */
  36. private $productId;
  37. public function getId()
  38. {
  39. return $this->id;
  40. }
  41. public function getName()
  42. {
  43. return $this->name;
  44. }
  45. public function setName($name)
  46. {
  47. $this->name = $name;
  48. }
  49. public function getSku()
  50. {
  51. return $this->sku;
  52. }
  53. public function setSku($sku)
  54. {
  55. $this->sku = $sku;
  56. }
  57. public function getQuantity()
  58. {
  59. return $this->quantity;
  60. }
  61. public function setQuantity($quantity)
  62. {
  63. $this->quantity = $quantity;
  64. }
  65. public function setProduct(Product $product)
  66. {
  67. $this->product = $product;
  68. }
  69. public function getProduct()
  70. {
  71. return $this->product;
  72. }
  73. public function setProductId($productId)
  74. {
  75. $this->productId = $productId;
  76. }
  77. public function getProductId()
  78. {
  79. return $this->productId;
  80. }
  81. }