src/Component/Vendor/Entity/ShopUser.php line 16

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file has been created by developers from BitBag.
  4.  * Feel free to contact us once you face any issues or want to start
  5.  * You can find more information about us on https://bitbag.io and write us
  6.  * an email on [email protected].
  7.  */
  8. declare(strict_types=1);
  9. namespace BitBag\OpenMarketplace\Component\Vendor\Entity;
  10. use Sylius\Component\Core\Model\ShopUser as BaseShopUser;
  11. class ShopUser extends BaseShopUser implements ShopUserInterface
  12. {
  13.     use ShopUserTrait;
  14.     private const ROLE_VENDOR 'ROLE_VENDOR';
  15.     public function getRoles(): array
  16.     {
  17.         $roles $this->roles;
  18.         $vendor $this->getVendor();
  19.         if (null !== $vendor && $vendor->isVerified() && $vendor->isEnabled()) {
  20.             $roles[] = self::ROLE_VENDOR;
  21.         }
  22.         return array_unique($roles);
  23.     }
  24. }