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