src/Entity/User/AdminUser.php line 23

  1. <?php
  2. /*
  3.  * This file is part of the Pellipop project.
  4.  *
  5.  * (c) Mobizel
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace App\Entity\User;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Monofony\Contracts\Core\Model\User\AdminAvatarInterface;
  14. use Monofony\Contracts\Core\Model\User\AdminUserInterface;
  15. use Sylius\Component\User\Model\User as BaseUser;
  16. #[ORM\Entity]
  17. #[ORM\Table(name'sylius_admin_user')]
  18. class AdminUser extends BaseUser implements AdminUserInterface
  19. {
  20.     #[ORM\Column(type'string'nullabletrue)]
  21.     private ?string $lastName null;
  22.     #[ORM\Column(type'string'nullabletrue)]
  23.     private ?string $firstName null;
  24.     #[ORM\OneToOne(targetEntityAdminAvatar::class, cascade: ['persist'])]
  25.     private ?AdminAvatarInterface $avatar null;
  26.     public function __construct()
  27.     {
  28.         parent::__construct();
  29.         $this->roles = [self::DEFAULT_ADMIN_ROLE];
  30.     }
  31.     public function getLastName(): ?string
  32.     {
  33.         return $this->lastName;
  34.     }
  35.     public function setLastName(?string $lastName): void
  36.     {
  37.         $this->lastName $lastName;
  38.     }
  39.     public function getFirstName(): ?string
  40.     {
  41.         return $this->firstName;
  42.     }
  43.     public function setFirstName(?string $firstName): void
  44.     {
  45.         $this->firstName $firstName;
  46.     }
  47.     public function getAvatar(): ?AdminAvatarInterface
  48.     {
  49.         return $this->avatar;
  50.     }
  51.     public function setAvatar(?AdminAvatarInterface $avatar): void
  52.     {
  53.         $this->avatar $avatar;
  54.     }
  55. }