src/Entity/Reviewer.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use App\Util\SecurityUtil;
  9. use App\Entity\Traits\UserPropertyTrait;
  10. use App\Entity\Traits\ReviewBatchMethodTrait;
  11. use App\Entity\Traits\NameTrait;
  12. /**
  13.  *
  14.  * @ORM\Entity(repositoryClass="App\Repository\ReviewerRepository")
  15.  * @UniqueEntity("username")
  16.  */
  17. class Reviewer implements UserInterfacePasswordAuthenticatedUserInterface
  18. {
  19.     use UserPropertyTraitReviewBatchMethodTrait;
  20.     const NAME '评审专家';
  21.     /**
  22.      *
  23.      * @ORM\ManyToOne(targetEntity="ReviewBatch")
  24.      */
  25.     protected $reviewBatch;
  26.     /**
  27.      *
  28.      * @ORM\Column
  29.      */
  30.     protected $password;
  31.     /**
  32.      *
  33.      * @see UserInterface
  34.      */
  35.     public function getRoles(): array
  36.     {
  37.         return [
  38.             SecurityUtil::ROLE_REVIEWER
  39.         ];
  40.     }
  41.     public function getPassword(): ?string
  42.     {
  43.         return $this->password;
  44.     }
  45.     public function setPassword(string $password)
  46.     {
  47.         $this->password $password;
  48.     }
  49. }