src/Entity/PointCategoryItem.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PointCategoryItemRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use JMS\Serializer\Annotation\Groups;
  7. /**
  8. * @ORM\Entity(repositoryClass=PointCategoryItemRepository::class)
  9. * @UniqueEntity(
  10. * fields={"slug"},
  11. * errorPath="slug",
  12. * message="Ce slug est déjà utilisé, veuillez en choisir un autre."
  13. * )
  14. */
  15. class PointCategoryItem
  16. {
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue
  20. * @ORM\Column(type="integer")
  21. */
  22. private $id;
  23. /**
  24. * @ORM\Column(type="string", length=255, unique=true)
  25. *
  26. * @Groups({ "pointCategory" })
  27. */
  28. private ?string $slug;
  29. /**
  30. * @ORM\Column(type="string", length=255)
  31. *
  32. * @Groups({ "pointCategory" })
  33. */
  34. private ?string $label;
  35. /**
  36. * @ORM\Column(type="string", length=255)
  37. *
  38. * @Groups({ "pointCategory" })
  39. */
  40. private ?string $symbol;
  41. /**
  42. * @ORM\Column(type="float", nullable=true)
  43. *
  44. * @Groups({ "pointCategory" })
  45. */
  46. private ?float $multiplication;
  47. /**
  48. * @ORM\ManyToOne(targetEntity=PointCategory::class, inversedBy="pointCategoryItems")
  49. * @ORM\JoinColumn(nullable=false)
  50. */
  51. private ?PointCategory $pointCategory = null;
  52. /**
  53. * @ORM\Column(type="boolean", nullable=true)
  54. *
  55. * @Groups({ "pointCategory" })
  56. */
  57. private ?bool $pointCategoryDefault = false;
  58. public function getId(): ?int
  59. {
  60. return $this->id;
  61. }
  62. public function getSlug(): ?string
  63. {
  64. return $this->slug;
  65. }
  66. public function setSlug(string $slug): self
  67. {
  68. $this->slug = $slug;
  69. return $this;
  70. }
  71. public function getLabel(): ?string
  72. {
  73. return $this->label;
  74. }
  75. public function setLabel(string $label): self
  76. {
  77. $this->label = $label;
  78. return $this;
  79. }
  80. public function getSymbol(): ?string
  81. {
  82. return $this->symbol;
  83. }
  84. public function setSymbol(string $symbol): self
  85. {
  86. $this->symbol = $symbol;
  87. return $this;
  88. }
  89. public function getMultiplication(): ?float
  90. {
  91. return $this->multiplication;
  92. }
  93. public function setMultiplication(?float $multiplication): self
  94. {
  95. $this->multiplication = $multiplication;
  96. return $this;
  97. }
  98. public function getPointCategory(): ?PointCategory
  99. {
  100. return $this->pointCategory;
  101. }
  102. public function setPointCategory(?PointCategory $pointCategory): self
  103. {
  104. $this->pointCategory = $pointCategory;
  105. return $this;
  106. }
  107. public function isPointCategoryDefault(): ?bool
  108. {
  109. return $this->pointCategoryDefault;
  110. }
  111. public function setPointCategoryDefault(?bool $pointCategoryDefault): self
  112. {
  113. $this->pointCategoryDefault = $pointCategoryDefault;
  114. return $this;
  115. }
  116. }