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 12;
  15.     public const ROLE_API_SYS 4;
  16.     public const ROLE_API_SHIPPING 5;
  17.     public const ROLE_API_ORDER 6;
  18.     public const ROLE_API_CATALOG 7;
  19.     public const ROLE_API_USER 8;
  20.     public const ROLE_API_TRACKING 9;
  21.     public const ROLE_API_MODULE 11;
  22.     public const ROLE_API_SYS_RETURNS 13;
  23.     public const ROLE_API_SYS_NOTIFICATION 23;
  24.     public const ROLE_API_SYSTEM 'ROLE_API_SYS';
  25.     public const ROLE_ADYEN_MONEYBOX 'ROLE_ADYEN_MONEYBOX';
  26.     public const ROLE_EMPLOYEE_DEVELOPER 'ROLE_EMPLOYEE_DEVELOPER';
  27.     public const ROLE_EMPLOYEE_SUPER_ADMIN 'ROLE_SUPER_ADMIN';
  28.     public const ROLE_EMPLOYEE_SALES_ADMIN 'ROLE_SALES_ADMIN';
  29.     public const ROLE_EMPLOYEE_TECH_SUPPORT 'ROLE_TECH_SUPPORT';
  30.     public const ROLE_EMPLOYEE_PRODUCTS 'ROLE_PRODUCTS';
  31.     public const ROLE_EMPLOYEE_DESIGN 'ROLE_DESIGN';
  32.     public const API_CUSTOMER_ROLE_NAMES = [
  33.         'ROLE_API_SHIPPING',
  34.         'ROLE_API_ORDER',
  35.         'ROLE_API_CATALOG',
  36.         'ROLE_API_USER',
  37.         'ROLE_API_TRACKING',
  38.         'ROLE_API_MODULE',
  39.     ];
  40.     /**
  41.      * @var int
  42.      *
  43.      * @ORM\Id
  44.      *
  45.      * @ORM\GeneratedValue(strategy="AUTO")
  46.      *
  47.      * @ORM\Column(type="integer", name="id_role")
  48.      */
  49.     private $id;
  50.     /**
  51.      * @var string
  52.      *
  53.      * @ORM\Column(type="string")
  54.      */
  55.     private $name;
  56.     /**
  57.      * @var Profile[]|ArrayCollection
  58.      *
  59.      * @ORM\ManyToMany(targetEntity="App\Entity\System\Profile", mappedBy="roles")
  60.      */
  61.     private $profiles;
  62.     /**
  63.      * @var Customer[]|ArrayCollection
  64.      *
  65.      * @ORM\ManyToMany(targetEntity="App\Entity\System\Customer", mappedBy="roles")
  66.      */
  67.     private $customers;
  68.     /**
  69.      * @var ArrayCollection<int, AdminAcl>|AdminAcl[]
  70.      *
  71.      * @ORM\ManyToMany(targetEntity="AdminAcl", inversedBy="roles")
  72.      *
  73.      * @ORM\JoinTable(name="role_admin_acl",
  74.      *      joinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id_role")},
  75.      *      inverseJoinColumns={@ORM\JoinColumn(name="admin_acl_id", referencedColumnName="id")}
  76.      *   )
  77.      */
  78.     private $routes;
  79.     public function __construct()
  80.     {
  81.         $this->profiles = new ArrayCollection();
  82.         $this->customers = new ArrayCollection();
  83.         $this->routes = new ArrayCollection();
  84.     }
  85.     /**
  86.      * @return int
  87.      */
  88.     public function getId(): int
  89.     {
  90.         return $this->id;
  91.     }
  92.     /**
  93.      * @param int $id
  94.      *
  95.      * @return Role
  96.      */
  97.     public function setId(int $id): Role
  98.     {
  99.         $this->id $id;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return string
  104.      */
  105.     public function getName(): string
  106.     {
  107.         return $this->name;
  108.     }
  109.     /**
  110.      * @param string $name
  111.      *
  112.      * @return Role
  113.      */
  114.     public function setName(string $name): Role
  115.     {
  116.         $this->name $name;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Profile[]|ArrayCollection
  121.      */
  122.     public function getProfiles()
  123.     {
  124.         return $this->profiles;
  125.     }
  126.     /**
  127.      * @param Profile[]|ArrayCollection $profiles
  128.      *
  129.      * @return Role
  130.      */
  131.     public function setProfiles($profiles): Role
  132.     {
  133.         $this->profiles $profiles;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Customer[]|ArrayCollection
  138.      */
  139.     public function getCustomers()
  140.     {
  141.         return $this->customers;
  142.     }
  143.     /**
  144.      * @param Customer[]|ArrayCollection $customers
  145.      */
  146.     public function setCustomers($customers): Role
  147.     {
  148.         $this->customers $customers;
  149.         return $this;
  150.     }
  151.     /**
  152.      * @return AdminAcl[]|ArrayCollection<int, AdminAcl>
  153.      */
  154.     public function getRoutes()
  155.     {
  156.         return $this->routes;
  157.     }
  158.     /**
  159.      * @param AdminAcl[]|ArrayCollection<int, AdminAcl> $routes
  160.      *
  161.      * @return Role
  162.      */
  163.     public function setRoutes($routes)
  164.     {
  165.         $this->routes $routes;
  166.         return $this;
  167.     }
  168. }