src/Entity/ProductPrice.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table(name="product_prices")
  6. * @ORM\Entity
  7. */
  8. class ProductPrice
  9. {
  10. /**
  11. * @var int
  12. *
  13. * @ORM\Column(name="id", type="integer", nullable=false)
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="IDENTITY")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="prices")
  20. * @ORM\JoinColumn(name="products_id", referencedColumnName="products_id", nullable=true, onDelete="CASCADE")
  21. */
  22. private $product;
  23. /**
  24. * @ORM\ManyToOne(targetEntity="App\Entity\PriceGroup", cascade={"persist"})
  25. * @ORM\JoinColumn(name="price_group_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  26. */
  27. private $group;
  28. /**
  29. * @var float
  30. * @ORM\Column(name="price", type="decimal", precision=15, scale=4, nullable=false, options={"default"="0.0000"})
  31. */
  32. private $price = '0.0000';
  33. public function getId(): int {
  34. return $this->id;
  35. }
  36. public function getProduct() {
  37. return $this->product;
  38. }
  39. public function getGroup() {
  40. return $this->group;
  41. }
  42. public function getPrice(): float {
  43. return $this->price;
  44. }
  45. public function setId(int $id): void {
  46. $this->id = $id;
  47. }
  48. public function setProduct($product): void {
  49. $this->product = $product;
  50. }
  51. public function setGroup($group): void {
  52. $this->group = $group;
  53. }
  54. public function setPrice(float $price): void {
  55. $this->price = $price;
  56. }
  57. }