vendor/croisiland/common-bundle/src/Entity/Price/PriceCost.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Croisiland\CommonBundle\Entity\Price;
  4. use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
  5. use Croisiland\CommonBundle\Entity\Traits\CurrencyTrait;
  6. use Croisiland\CommonBundle\Repository\Price\PriceCostRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * @ORM\Entity(repositoryClass=PriceCostRepository::class)
  10. */
  11. class PriceCost
  12. {
  13. use LifecycleUserIdentifierTrait;
  14. use CurrencyTrait;
  15. /**
  16. * @ORM\Id
  17. *
  18. * @ORM\GeneratedValue
  19. *
  20. * @ORM\Column(type="integer")
  21. */
  22. private ?int $id = null;
  23. /**
  24. * @ORM\ManyToOne(targetEntity=PriceCostType::class)
  25. *
  26. * @ORM\JoinColumn(nullable=true)
  27. */
  28. private ?PriceCostType $type = null;
  29. /**
  30. * @ORM\Column(type="float")
  31. */
  32. private ?float $value = null;
  33. /**
  34. * @ORM\ManyToOne(targetEntity=Price::class, inversedBy="priceCosts")
  35. *
  36. * @ORM\JoinColumn(nullable=false)
  37. */
  38. private ?Price $price = null;
  39. /**
  40. * @ORM\Column(type="integer")
  41. */
  42. private int $position = 0;
  43. public function getId(): ?int
  44. {
  45. return $this->id;
  46. }
  47. public function getType(): ?PriceCostType
  48. {
  49. return $this->type;
  50. }
  51. public function setType(PriceCostType $type): self
  52. {
  53. $this->type = $type;
  54. return $this;
  55. }
  56. public function getValue(): ?float
  57. {
  58. return $this->value;
  59. }
  60. public function setValue(float $value): self
  61. {
  62. $this->value = $value;
  63. return $this;
  64. }
  65. public function getPrice(): ?Price
  66. {
  67. return $this->price;
  68. }
  69. public function setPrice(?Price $price): self
  70. {
  71. $this->price = $price;
  72. return $this;
  73. }
  74. public function getPosition(): int
  75. {
  76. return $this->position;
  77. }
  78. public function setPosition(int $position): self
  79. {
  80. $this->position = $position;
  81. return $this;
  82. }
  83. public function __clone()
  84. {
  85. $this->id = null;
  86. }
  87. }