src/Entity/System/Group.php line 13

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. * @ORM\Entity(repositoryClass="App\Repository\System\GroupRepository")
  7. *
  8. * @ORM\Table(name="ps_group")
  9. */
  10. class Group
  11. {
  12. public const GROUP_ID_GENERAL = 1;
  13. public const GROUP_ID_WHOLESALER = 2;
  14. public const GROUP_ID_EMPLOYEE = 3;
  15. /**
  16. * @var int
  17. *
  18. * @ORM\Id
  19. *
  20. * @ORM\GeneratedValue(strategy="AUTO")
  21. *
  22. * @ORM\Column(type="integer", name="id_group")
  23. */
  24. private $id;
  25. /**
  26. * @var string
  27. *
  28. * @ORM\Column(type="string", length=32)
  29. */
  30. private $name;
  31. /**
  32. * @var Customer[]|ArrayCollection
  33. *
  34. * @ORM\OneToMany(targetEntity="Customer", mappedBy="group")
  35. */
  36. private $customers;
  37. public function __construct()
  38. {
  39. $this->customers = new ArrayCollection();
  40. }
  41. /**
  42. * @return int
  43. */
  44. public function getId(): int
  45. {
  46. return $this->id;
  47. }
  48. /**
  49. * @param int $id
  50. *
  51. * @return Group
  52. */
  53. public function setId(int $id): self
  54. {
  55. $this->id = $id;
  56. return $this;
  57. }
  58. /**
  59. * @return string
  60. */
  61. public function getName(): string
  62. {
  63. return $this->name;
  64. }
  65. /**
  66. * @param string $name
  67. *
  68. * @return Group
  69. */
  70. public function setName(string $name): self
  71. {
  72. $this->name = $name;
  73. return $this;
  74. }
  75. /**
  76. * @return Customer[]|ArrayCollection
  77. */
  78. public function getCustomers(): array
  79. {
  80. return $this->customers;
  81. }
  82. /**
  83. * @param Customer[]|ArrayCollection $customers
  84. *
  85. * @return Group
  86. */
  87. public function setCustomers(array $customers): self
  88. {
  89. $this->customers = $customers;
  90. return $this;
  91. }
  92. }