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_API_SYSTEM 'ROLE_API_SYS';
  15.     public const ROLE_DEV 'ROLE_DEV';
  16.     public const ROLE_USER_ID 12;
  17.     public const ROLE_ADYEN_MONEYBOX 'ROLE_ADYEN_MONEYBOX';
  18.     public const API_CUSTOMER_ROLES = [
  19.         'ROLE_API_SHIPPING',
  20.         'ROLE_API_ORDER',
  21.         'ROLE_API_CATALOG',
  22.         'ROLE_API_USER',
  23.         'ROLE_API_TRACKING',
  24.         'ROLE_API_MODULE',
  25.     ];
  26.     /**
  27.      * @var int
  28.      *
  29.      * @ORM\Id
  30.      *
  31.      * @ORM\GeneratedValue(strategy="AUTO")
  32.      *
  33.      * @ORM\Column(type="integer", name="id_role")
  34.      */
  35.     private $id;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(type="string")
  40.      */
  41.     private $name;
  42.     /**
  43.      * @var Profile[]|ArrayCollection
  44.      *
  45.      * @ORM\ManyToMany(targetEntity="App\Entity\System\Profile", mappedBy="roles")
  46.      */
  47.     private $profiles;
  48.     /**
  49.      * @var Customer[]|ArrayCollection
  50.      *
  51.      * @ORM\ManyToMany(targetEntity="App\Entity\System\Customer", mappedBy="roles")
  52.      */
  53.     private $customers;
  54.     public function __construct()
  55.     {
  56.         $this->profiles = new ArrayCollection();
  57.         $this->customers = new ArrayCollection();
  58.     }
  59.     /**
  60.      * @return int
  61.      */
  62.     public function getId(): int
  63.     {
  64.         return $this->id;
  65.     }
  66.     /**
  67.      * @param int $id
  68.      *
  69.      * @return Role
  70.      */
  71.     public function setId(int $id): Role
  72.     {
  73.         $this->id $id;
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return string
  78.      */
  79.     public function getName(): string
  80.     {
  81.         return $this->name;
  82.     }
  83.     /**
  84.      * @param string $name
  85.      *
  86.      * @return Role
  87.      */
  88.     public function setName(string $name): Role
  89.     {
  90.         $this->name $name;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Profile[]|ArrayCollection
  95.      */
  96.     public function getProfiles()
  97.     {
  98.         return $this->profiles;
  99.     }
  100.     /**
  101.      * @param Profile[]|ArrayCollection $profiles
  102.      *
  103.      * @return Role
  104.      */
  105.     public function setProfiles($profiles): Role
  106.     {
  107.         $this->profiles $profiles;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Customer[]|ArrayCollection
  112.      */
  113.     public function getCustomers()
  114.     {
  115.         return $this->customers;
  116.     }
  117.     /**
  118.      * @param Customer[]|ArrayCollection $customers
  119.      */
  120.     public function setCustomers($customers): Role
  121.     {
  122.         $this->customers $customers;
  123.         return $this;
  124.     }
  125. }