src/Entity/System/CodeDiscountRuleType.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Class CodeDiscountRuleType
  7. *
  8. * @ORM\Table(name="code_discount_rule_type")
  9. *
  10. * @ORM\Entity(repositoryClass="App\Repository\System\CodeDiscountRuleTypeRepository")
  11. */
  12. class CodeDiscountRuleType
  13. {
  14. public const TAXONOMY_TYPE = 1;
  15. public const PRODUCT_TYPE = 2;
  16. /**
  17. * @ORM\Id
  18. *
  19. * @ORM\GeneratedValue("NONE")
  20. *
  21. * @ORM\Column(type="integer")
  22. */
  23. private int $id;
  24. /**
  25. * @ORM\Column(type="string", unique=true)
  26. */
  27. private string $name;
  28. /**
  29. * @var ArrayCollection<int, CodeDiscountRule>|CodeDiscountRuleType
  30. *
  31. * @ORM\OneToMany(targetEntity="CodeDiscountRule", mappedBy="codeDiscountRuleType")
  32. */
  33. private $codeDiscountRules;
  34. public function setId(int $id): CodeDiscountRuleType
  35. {
  36. $this->id = $id;
  37. return $this;
  38. }
  39. public function getId(): int
  40. {
  41. return $this->id;
  42. }
  43. public function getName(): string
  44. {
  45. return $this->name;
  46. }
  47. public function setName(string $name): CodeDiscountRuleType
  48. {
  49. $this->name = $name;
  50. return $this;
  51. }
  52. /**
  53. * @return ArrayCollection<int, CodeDiscountRule>
  54. */
  55. public function getCodeDiscountRules(): ArrayCollection
  56. {
  57. return $this->codeDiscountRules;
  58. }
  59. /**
  60. * @param ArrayCollection<int, CodeDiscountRule> $codeDiscountRules
  61. */
  62. public function setCodeDiscountRules(ArrayCollection $codeDiscountRules): CodeDiscountRuleType
  63. {
  64. $this->codeDiscountRules = $codeDiscountRules;
  65. return $this;
  66. }
  67. }