<?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 = 12;
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_API_SYS_NOTIFICATION = 23;
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_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 API_CUSTOMER_ROLE_NAMES = [
'ROLE_API_SHIPPING',
'ROLE_API_ORDER',
'ROLE_API_CATALOG',
'ROLE_API_USER',
'ROLE_API_TRACKING',
'ROLE_API_MODULE',
];
/**
* @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 Profile[]|ArrayCollection
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\Profile", mappedBy="roles")
*/
private $profiles;
/**
* @var Customer[]|ArrayCollection
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\Customer", mappedBy="roles")
*/
private $customers;
/**
* @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;
public function __construct()
{
$this->profiles = new ArrayCollection();
$this->customers = 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 Profile[]|ArrayCollection
*/
public function getProfiles()
{
return $this->profiles;
}
/**
* @param Profile[]|ArrayCollection $profiles
*
* @return Role
*/
public function setProfiles($profiles): Role
{
$this->profiles = $profiles;
return $this;
}
/**
* @return Customer[]|ArrayCollection
*/
public function getCustomers()
{
return $this->customers;
}
/**
* @param Customer[]|ArrayCollection $customers
*/
public function setCustomers($customers): Role
{
$this->customers = $customers;
return $this;
}
/**
* @return AdminAcl[]|ArrayCollection<int, AdminAcl>
*/
public function getRoutes()
{
return $this->routes;
}
/**
* @param AdminAcl[]|ArrayCollection<int, AdminAcl> $routes
*
* @return Role
*/
public function setRoutes($routes)
{
$this->routes = $routes;
return $this;
}
}