<?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_API_SYSTEM = 'ROLE_API_SYS';
public const ROLE_DEV = 'ROLE_DEV';
public const ROLE_USER_ID = 12;
public const ROLE_ADYEN_MONEYBOX = 'ROLE_ADYEN_MONEYBOX';
public const API_CUSTOMER_ROLES = [
'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;
public function __construct()
{
$this->profiles = new ArrayCollection();
$this->customers = 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;
}
}