<?php
namespace App\Entity\System;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Role
*
* @ORM\Entity(repositoryClass="App\Repository\System\RoleRepository")
*
* @ORM\Table(name="ps_role")
*/
class Role
{
public const ROLE_USER_ID = 12;
public const ROLE_EMPLOYEE_ID = 20;
public const ROLE_API_SYS = 4;
public const ROLE_API_SHIPPING = 5;
public const ROLE_API_ORDER = 6;
public const ROLE_API_CATALOG = 7;
public const ROLE_API_USER = 8;
public const ROLE_API_TRACKING = 9;
public const ROLE_API_MODULE = 11;
public const ROLE_API_SYS_RETURNS = 13;
public const ROLE_TECH_SUPPORT_ID = 15;
public const ROLE_API_SYS_NOTIFICATION = 23;
public const ROLE_ADYEN_MONEYBOX_ID = 21;
public const ROLE_ADYEN_PAYMENT_METHOD_KLARNA_B2B_ID = 25;
public const ROLE_ADYEN_PAYMENT_METHOD_GOOGLEPAY_ID = 26;
public const ROLE_ADYEN_PAYMENT_METHOD_EBANKING_FI_ID = 28;
public const ROLE_STRIPE_PAYMENT_METHOD_CARD_ID = 34;
public const ROLE_STRIPE_PAYMENT_METHOD_PAYPAL_ID = 35;
public const ROLE_STRIPE_PAYMENT_METHOD_GOOGLE_PAY_ID = 36;
public const ROLE_STRIPE_PAYMENT_METHOD_APPLE_PAY_ID = 37;
public const ROLE_STRIPE_PAYMENT_METHOD_LINK_ID = 38;
public const ROLE_STRIPE_PAYMENT_METHOD_REVOLUT_PAY_ID = 39;
public const ROLE_STRIPE_PAYMENT_METHOD_BANCONTACT_ID = 40;
public const ROLE_STRIPE_PAYMENT_METHOD_KLARNA_ID = 41;
public const ROLE_STRIPE_PAYMENT_METHOD_SEPA_DEBIT_ID = 42;
public const ROLE_STRIPE_PAYMENT_METHOD_IDEAL_ID = 43;
public const ROLE_SHOPS = 44;
public const ROLE_API_SYSTEM = 'ROLE_API_SYS';
public const ROLE_ADYEN_MONEYBOX = 'ROLE_ADYEN_MONEYBOX';
public const ROLE_EMPLOYEE_DEVELOPER = 'ROLE_EMPLOYEE_DEVELOPER';
public const ROLE_EMPLOYEE = 'ROLE_EMPLOYEE';
public const ROLE_EMPLOYEE_SUPER_ADMIN = 'ROLE_SUPER_ADMIN';
public const ROLE_EMPLOYEE_SALES_ADMIN = 'ROLE_SALES_ADMIN';
public const ROLE_EMPLOYEE_TECH_SUPPORT = 'ROLE_TECH_SUPPORT';
public const ROLE_EMPLOYEE_PRODUCTS = 'ROLE_PRODUCTS';
public const ROLE_EMPLOYEE_DESIGN = 'ROLE_DESIGN';
public const ROLE_EMPLOYEE_SHOPS = 'ROLE_SHOPS';
public const API_CUSTOMER_ROLE_NAMES = [
'ROLE_API_SHIPPING',
'ROLE_API_ORDER',
'ROLE_API_CATALOG',
'ROLE_API_USER',
'ROLE_API_TRACKING',
'ROLE_API_MODULE',
];
public const STRIPE_PAYMENT_IDS = [
self::ROLE_STRIPE_PAYMENT_METHOD_CARD_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_PAYPAL_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_GOOGLE_PAY_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_APPLE_PAY_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_LINK_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_REVOLUT_PAY_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_BANCONTACT_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_KLARNA_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_SEPA_DEBIT_ID,
self::ROLE_STRIPE_PAYMENT_METHOD_IDEAL_ID,
];
public const ADYEN_PAYMENT_IDS = [
self::ROLE_ADYEN_MONEYBOX_ID,
self::ROLE_ADYEN_PAYMENT_METHOD_KLARNA_B2B_ID,
self::ROLE_ADYEN_PAYMENT_METHOD_GOOGLEPAY_ID,
self::ROLE_ADYEN_PAYMENT_METHOD_EBANKING_FI_ID,
];
/**
* @var int
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @ORM\Column(type="integer", name="id_role")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $name;
/**
* @var ArrayCollection<int, Customer>|Customer[]
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\Customer", mappedBy="roles")
*/
private $customers;
/**
* @var ArrayCollection<int, Employee>|Employee[]
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\Employee", mappedBy="roleCollection")
*/
private $employees;
/**
* @var ArrayCollection<int, AdminAcl>|AdminAcl[]
*
* @ORM\ManyToMany(targetEntity="AdminAcl", inversedBy="roles")
*
* @ORM\JoinTable(name="role_admin_acl",
* joinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id_role")},
* inverseJoinColumns={@ORM\JoinColumn(name="admin_acl_id", referencedColumnName="id")}
* )
*/
private $routes;
/**
* @var bool
*
* @ORM\Column(type="boolean", options={"default" : "0"}, nullable=true)
*/
private $employee = false;
public function __construct()
{
$this->customers = new ArrayCollection();
$this->employees = new ArrayCollection();
$this->routes = new ArrayCollection();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*
* @return Role
*/
public function setId(int $id): Role
{
$this->id = $id;
return $this;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*
* @return Role
*/
public function setName(string $name): Role
{
$this->name = $name;
return $this;
}
/**
* @return Customer[]|ArrayCollection<int, Customer>
*/
public function getCustomers()
{
return $this->customers;
}
/**
* @param Customer[]|ArrayCollection<int, Customer> $customers
*/
public function setCustomers($customers): Role
{
$this->customers = $customers;
return $this;
}
/**
* @return Employee[]|ArrayCollection<int, Employee>
*/
public function getEmployees()
{
return $this->employees;
}
/**
* @param Employee[]|ArrayCollection<int, Employee> $employees
*/
public function setEmployees($employees): Role
{
$this->employees = $employees;
return $this;
}
/**
* @return AdminAcl[]|ArrayCollection<int, AdminAcl>
*/
public function getRoutes()
{
return $this->routes;
}
/**
* @param AdminAcl[]|ArrayCollection<int, AdminAcl> $routes
*/
public function setRoutes($routes): Role
{
$this->routes = $routes;
return $this;
}
public function isEmployee(): bool
{
return $this->employee;
}
public function setEmployee(bool $employee): Role
{
$this->employee = $employee;
return $this;
}
}