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