vendor/roothirsch/delivery-time-estimator-bundle/Entity/Product.php line 19

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\DeliveryTimeEstimatorBundle\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use Roothirsch\DeliveryTimeEstimatorBundle\Repository\ProductRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9. * @ApiResource(
  10. * shortName="DeliveryTimeEstimator/Product",
  11. * order={"position": "ASC"}
  12. * )
  13. * @ORM\Entity
  14. * @ORM\Table(name="delivery_time_estimator_product")
  15. */
  16. class Product
  17. {
  18. /**
  19. * @ORM\Id
  20. * @ORM\GeneratedValue
  21. * @ORM\Column(type="integer")
  22. * @Groups({"read"})
  23. */
  24. private $id;
  25. /**
  26. * @ORM\Column(type="string", length=255)
  27. * @Groups({"read"})
  28. * @Gedmo\Translatable
  29. */
  30. private $title;
  31. /**
  32. * @ORM\Column(type="integer")
  33. * @Groups({"read"})
  34. */
  35. private $manufacturingDays;
  36. /**
  37. * @ORM\Column(type="boolean")
  38. * @Groups({"read"})
  39. */
  40. private $onRequestOnly;
  41. /**
  42. * @Gedmo\SortablePosition
  43. * @ORM\Column(name="position", type="integer")
  44. * @Groups({"read"})
  45. */
  46. private $position = 9999;
  47. /**
  48. * @Gedmo\SortableGroup
  49. * @ORM\ManyToOne(targetEntity=ProductGroup::class, inversedBy="products")
  50. */
  51. private $productGroup;
  52. public function getId(): ?int
  53. {
  54. return $this->id;
  55. }
  56. public function getTitle(): ?string
  57. {
  58. return $this->title;
  59. }
  60. public function setTitle(string $title): self
  61. {
  62. $this->title = $title;
  63. return $this;
  64. }
  65. public function getManufacturingDays(): ?int
  66. {
  67. return $this->manufacturingDays;
  68. }
  69. public function setManufacturingDays(int $manufacturingDays): self
  70. {
  71. $this->manufacturingDays = $manufacturingDays;
  72. return $this;
  73. }
  74. public function getOnRequestOnly(): ?bool
  75. {
  76. return $this->onRequestOnly;
  77. }
  78. public function setOnRequestOnly(bool $onRequestOnly): self
  79. {
  80. $this->onRequestOnly = $onRequestOnly;
  81. return $this;
  82. }
  83. public function getProductGroup(): ?ProductGroup
  84. {
  85. return $this->productGroup;
  86. }
  87. public function setProductGroup(?ProductGroup $productGroup): self
  88. {
  89. $this->productGroup = $productGroup;
  90. return $this;
  91. }
  92. public function getPosition() {
  93. return $this->position;
  94. }
  95. public function setPosition($position) {
  96. $this->position = $position;
  97. }
  98. }