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 ROLE_STRIPE_PAYMENT_METHOD_PAYPAL = 'ROLE_STRIPE_PAYMENT_METHOD_PAYPAL';
  53. public const ROLE_STRIPE_PRODUCTS_CART = 'ROLE_STRIPE_PRODUCTS_CART';
  54. public const API_CUSTOMER_ROLE_NAMES = [
  55. 'ROLE_API_SHIPPING',
  56. 'ROLE_API_ORDER',
  57. 'ROLE_API_CATALOG',
  58. 'ROLE_API_USER',
  59. 'ROLE_API_TRACKING',
  60. 'ROLE_API_MODULE',
  61. ];
  62. public const STRIPE_PAYMENT_IDS = [
  63. self::ROLE_STRIPE_PAYMENT_METHOD_CARD_ID,
  64. self::ROLE_STRIPE_PAYMENT_METHOD_PAYPAL_ID,
  65. self::ROLE_STRIPE_PAYMENT_METHOD_GOOGLE_PAY_ID,
  66. self::ROLE_STRIPE_PAYMENT_METHOD_APPLE_PAY_ID,
  67. self::ROLE_STRIPE_PAYMENT_METHOD_LINK_ID,
  68. self::ROLE_STRIPE_PAYMENT_METHOD_REVOLUT_PAY_ID,
  69. self::ROLE_STRIPE_PAYMENT_METHOD_BANCONTACT_ID,
  70. self::ROLE_STRIPE_PAYMENT_METHOD_KLARNA_ID,
  71. self::ROLE_STRIPE_PAYMENT_METHOD_SEPA_DEBIT_ID,
  72. self::ROLE_STRIPE_PAYMENT_METHOD_IDEAL_ID,
  73. ];
  74. public const ADYEN_PAYMENT_IDS = [
  75. self::ROLE_ADYEN_MONEYBOX_ID,
  76. self::ROLE_ADYEN_PAYMENT_METHOD_KLARNA_B2B_ID,
  77. self::ROLE_ADYEN_PAYMENT_METHOD_GOOGLEPAY_ID,
  78. self::ROLE_ADYEN_PAYMENT_METHOD_EBANKING_FI_ID,
  79. ];
  80. /**
  81. * @var int
  82. *
  83. * @ORM\Id
  84. *
  85. * @ORM\GeneratedValue(strategy="AUTO")
  86. *
  87. * @ORM\Column(type="integer", name="id_role")
  88. */
  89. private $id;
  90. /**
  91. * @var string
  92. *
  93. * @ORM\Column(type="string")
  94. */
  95. private $name;
  96. /**
  97. * @var ArrayCollection<int, Customer>|Customer[]
  98. *
  99. * @ORM\ManyToMany(targetEntity="App\Entity\System\Customer", mappedBy="roles")
  100. */
  101. private $customers;
  102. /**
  103. * @var ArrayCollection<int, Employee>|Employee[]
  104. *
  105. * @ORM\ManyToMany(targetEntity="App\Entity\System\Employee", mappedBy="roleCollection")
  106. */
  107. private $employees;
  108. /**
  109. * @var ArrayCollection<int, AdminAcl>|AdminAcl[]
  110. *
  111. * @ORM\ManyToMany(targetEntity="AdminAcl", inversedBy="roles")
  112. *
  113. * @ORM\JoinTable(name="role_admin_acl",
  114. * joinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id_role")},
  115. * inverseJoinColumns={@ORM\JoinColumn(name="admin_acl_id", referencedColumnName="id")}
  116. * )
  117. */
  118. private $routes;
  119. /**
  120. * @var bool
  121. *
  122. * @ORM\Column(type="boolean", options={"default" : "0"}, nullable=true)
  123. */
  124. private $employee = false;
  125. public function __construct()
  126. {
  127. $this->customers = new ArrayCollection();
  128. $this->employees = new ArrayCollection();
  129. $this->routes = new ArrayCollection();
  130. }
  131. /**
  132. * @return int
  133. */
  134. public function getId(): int
  135. {
  136. return $this->id;
  137. }
  138. /**
  139. * @param int $id
  140. *
  141. * @return Role
  142. */
  143. public function setId(int $id): Role
  144. {
  145. $this->id = $id;
  146. return $this;
  147. }
  148. /**
  149. * @return string
  150. */
  151. public function getName(): string
  152. {
  153. return $this->name;
  154. }
  155. /**
  156. * @param string $name
  157. *
  158. * @return Role
  159. */
  160. public function setName(string $name): Role
  161. {
  162. $this->name = $name;
  163. return $this;
  164. }
  165. /**
  166. * @return Customer[]|ArrayCollection<int, Customer>
  167. */
  168. public function getCustomers()
  169. {
  170. return $this->customers;
  171. }
  172. /**
  173. * @param Customer[]|ArrayCollection<int, Customer> $customers
  174. */
  175. public function setCustomers($customers): Role
  176. {
  177. $this->customers = $customers;
  178. return $this;
  179. }
  180. /**
  181. * @return Employee[]|ArrayCollection<int, Employee>
  182. */
  183. public function getEmployees()
  184. {
  185. return $this->employees;
  186. }
  187. /**
  188. * @param Employee[]|ArrayCollection<int, Employee> $employees
  189. */
  190. public function setEmployees($employees): Role
  191. {
  192. $this->employees = $employees;
  193. return $this;
  194. }
  195. /**
  196. * @return AdminAcl[]|ArrayCollection<int, AdminAcl>
  197. */
  198. public function getRoutes()
  199. {
  200. return $this->routes;
  201. }
  202. /**
  203. * @param AdminAcl[]|ArrayCollection<int, AdminAcl> $routes
  204. */
  205. public function setRoutes($routes): Role
  206. {
  207. $this->routes = $routes;
  208. return $this;
  209. }
  210. public function isEmployee(): bool
  211. {
  212. return $this->employee;
  213. }
  214. public function setEmployee(bool $employee): Role
  215. {
  216. $this->employee = $employee;
  217. return $this;
  218. }
  219. }