src/Entity/System/Role.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 Role
  7. *
  8. * @ORM\Entity(repositoryClass="App\Repository\System\RoleRepository")
  9. *
  10. * @ORM\Table(name="ps_role")
  11. */
  12. class Role
  13. {
  14. public const ROLE_USER_ID = 12;
  15. public const ROLE_EMPLOYEE_ID = 20;
  16. public const ROLE_API_SYS = 4;
  17. public const ROLE_API_SHIPPING = 5;
  18. public const ROLE_API_ORDER = 6;
  19. public const ROLE_API_CATALOG = 7;
  20. public const ROLE_API_USER = 8;
  21. public const ROLE_API_TRACKING = 9;
  22. public const ROLE_API_MODULE = 11;
  23. public const ROLE_TECH_SUPPORT_ID = 15;
  24. public const ROLE_API_SYS_NOTIFICATION = 23;
  25. public const ROLE_ADYEN_MONEYBOX_ID = 21;
  26. public const ROLE_ADYEN_PAYMENT_METHOD_KLARNA_B2B_ID = 25;
  27. public const ROLE_ADYEN_PAYMENT_METHOD_GOOGLEPAY_ID = 26;
  28. public const ROLE_ADYEN_PAYMENT_METHOD_EBANKING_FI_ID = 28;
  29. public const ROLE_STRIPE_PAYMENT_METHOD_CARD_ID = 34;
  30. public const ROLE_STRIPE_PAYMENT_METHOD_PAYPAL_ID = 35;
  31. public const ROLE_STRIPE_PAYMENT_METHOD_GOOGLE_PAY_ID = 36;
  32. public const ROLE_STRIPE_PAYMENT_METHOD_APPLE_PAY_ID = 37;
  33. public const ROLE_STRIPE_PAYMENT_METHOD_LINK_ID = 38;
  34. public const ROLE_STRIPE_PAYMENT_METHOD_REVOLUT_PAY_ID = 39;
  35. public const ROLE_STRIPE_PAYMENT_METHOD_BANCONTACT_ID = 40;
  36. public const ROLE_STRIPE_PAYMENT_METHOD_KLARNA_ID = 41;
  37. public const ROLE_STRIPE_PAYMENT_METHOD_SEPA_DEBIT_ID = 42;
  38. public const ROLE_STRIPE_PAYMENT_METHOD_IDEAL_ID = 43;
  39. public const ROLE_SHOPS = 44;
  40. public const ROLE_RETURNS = 47;
  41. public const ROLE_API_SYSTEM = 'ROLE_API_SYS';
  42. public const ROLE_ADYEN_MONEYBOX = 'ROLE_ADYEN_MONEYBOX';
  43. public const ROLE_EMPLOYEE_DEVELOPER = 'ROLE_EMPLOYEE_DEVELOPER';
  44. public const ROLE_EMPLOYEE = 'ROLE_EMPLOYEE';
  45. public const ROLE_EMPLOYEE_SUPER_ADMIN = 'ROLE_SUPER_ADMIN';
  46. public const ROLE_EMPLOYEE_SALES_ADMIN = 'ROLE_SALES_ADMIN';
  47. public const ROLE_EMPLOYEE_TECH_SUPPORT = 'ROLE_TECH_SUPPORT';
  48. public const ROLE_EMPLOYEE_PRODUCTS = 'ROLE_PRODUCTS';
  49. public const ROLE_EMPLOYEE_DESIGN = 'ROLE_DESIGN';
  50. public const ROLE_EMPLOYEE_SHOPS = 'ROLE_SHOPS';
  51. public const ROLE_UPDATE_CREDIT_SERVICE = 'ROLE_UPDATE_CREDIT_SERVICE';
  52. public const API_CUSTOMER_ROLE_NAMES = [
  53. 'ROLE_API_SHIPPING',
  54. 'ROLE_API_ORDER',
  55. 'ROLE_API_CATALOG',
  56. 'ROLE_API_USER',
  57. 'ROLE_API_TRACKING',
  58. 'ROLE_API_MODULE',
  59. ];
  60. public const STRIPE_PAYMENT_IDS = [
  61. self::ROLE_STRIPE_PAYMENT_METHOD_CARD_ID,
  62. self::ROLE_STRIPE_PAYMENT_METHOD_PAYPAL_ID,
  63. self::ROLE_STRIPE_PAYMENT_METHOD_GOOGLE_PAY_ID,
  64. self::ROLE_STRIPE_PAYMENT_METHOD_APPLE_PAY_ID,
  65. self::ROLE_STRIPE_PAYMENT_METHOD_LINK_ID,
  66. self::ROLE_STRIPE_PAYMENT_METHOD_REVOLUT_PAY_ID,
  67. self::ROLE_STRIPE_PAYMENT_METHOD_BANCONTACT_ID,
  68. self::ROLE_STRIPE_PAYMENT_METHOD_KLARNA_ID,
  69. self::ROLE_STRIPE_PAYMENT_METHOD_SEPA_DEBIT_ID,
  70. self::ROLE_STRIPE_PAYMENT_METHOD_IDEAL_ID,
  71. ];
  72. public const ADYEN_PAYMENT_IDS = [
  73. self::ROLE_ADYEN_MONEYBOX_ID,
  74. self::ROLE_ADYEN_PAYMENT_METHOD_KLARNA_B2B_ID,
  75. self::ROLE_ADYEN_PAYMENT_METHOD_GOOGLEPAY_ID,
  76. self::ROLE_ADYEN_PAYMENT_METHOD_EBANKING_FI_ID,
  77. ];
  78. /**
  79. * @var int
  80. *
  81. * @ORM\Id
  82. *
  83. * @ORM\GeneratedValue(strategy="AUTO")
  84. *
  85. * @ORM\Column(type="integer", name="id_role")
  86. */
  87. private $id;
  88. /**
  89. * @var string
  90. *
  91. * @ORM\Column(type="string")
  92. */
  93. private $name;
  94. /**
  95. * @var ArrayCollection<int, Customer>|Customer[]
  96. *
  97. * @ORM\ManyToMany(targetEntity="App\Entity\System\Customer", mappedBy="roles")
  98. */
  99. private $customers;
  100. /**
  101. * @var ArrayCollection<int, Employee>|Employee[]
  102. *
  103. * @ORM\ManyToMany(targetEntity="App\Entity\System\Employee", mappedBy="roleCollection")
  104. */
  105. private $employees;
  106. /**
  107. * @var ArrayCollection<int, AdminAcl>|AdminAcl[]
  108. *
  109. * @ORM\ManyToMany(targetEntity="AdminAcl", inversedBy="roles")
  110. *
  111. * @ORM\JoinTable(name="role_admin_acl",
  112. * joinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id_role")},
  113. * inverseJoinColumns={@ORM\JoinColumn(name="admin_acl_id", referencedColumnName="id")}
  114. * )
  115. */
  116. private $routes;
  117. /**
  118. * @var bool
  119. *
  120. * @ORM\Column(type="boolean", options={"default" : "0"}, nullable=true)
  121. */
  122. private $employee = false;
  123. public function __construct()
  124. {
  125. $this->customers = new ArrayCollection();
  126. $this->employees = new ArrayCollection();
  127. $this->routes = new ArrayCollection();
  128. }
  129. /**
  130. * @return int
  131. */
  132. public function getId(): int
  133. {
  134. return $this->id;
  135. }
  136. /**
  137. * @param int $id
  138. *
  139. * @return Role
  140. */
  141. public function setId(int $id): Role
  142. {
  143. $this->id = $id;
  144. return $this;
  145. }
  146. /**
  147. * @return string
  148. */
  149. public function getName(): string
  150. {
  151. return $this->name;
  152. }
  153. /**
  154. * @param string $name
  155. *
  156. * @return Role
  157. */
  158. public function setName(string $name): Role
  159. {
  160. $this->name = $name;
  161. return $this;
  162. }
  163. /**
  164. * @return Customer[]|ArrayCollection<int, Customer>
  165. */
  166. public function getCustomers()
  167. {
  168. return $this->customers;
  169. }
  170. /**
  171. * @param Customer[]|ArrayCollection<int, Customer> $customers
  172. */
  173. public function setCustomers($customers): Role
  174. {
  175. $this->customers = $customers;
  176. return $this;
  177. }
  178. /**
  179. * @return Employee[]|ArrayCollection<int, Employee>
  180. */
  181. public function getEmployees()
  182. {
  183. return $this->employees;
  184. }
  185. /**
  186. * @param Employee[]|ArrayCollection<int, Employee> $employees
  187. */
  188. public function setEmployees($employees): Role
  189. {
  190. $this->employees = $employees;
  191. return $this;
  192. }
  193. /**
  194. * @return AdminAcl[]|ArrayCollection<int, AdminAcl>
  195. */
  196. public function getRoutes()
  197. {
  198. return $this->routes;
  199. }
  200. /**
  201. * @param AdminAcl[]|ArrayCollection<int, AdminAcl> $routes
  202. */
  203. public function setRoutes($routes): Role
  204. {
  205. $this->routes = $routes;
  206. return $this;
  207. }
  208. public function isEmployee(): bool
  209. {
  210. return $this->employee;
  211. }
  212. public function setEmployee(bool $employee): Role
  213. {
  214. $this->employee = $employee;
  215. return $this;
  216. }
  217. }