CustomOAuthUser.php 767 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Base\OAuthBundle\Security\Core\User;
  3. use HWI\Bundle\OAuthBundle\Security\Core\User\OAuthUser;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. */
  8. class CustomOAuthUser extends OAuthUser
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\Column(type="integer")
  13. * @ORM\GeneratedValue(strategy="AUTO")
  14. */
  15. protected $id;
  16. /**
  17. * @var array
  18. */
  19. protected $roles = array('ROLE_USER');
  20. /**
  21. * @return int
  22. */
  23. public function getId()
  24. {
  25. return $this->id;
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getRoles()
  31. {
  32. return $this->roles;
  33. }
  34. /**
  35. * @param array $roles
  36. */
  37. public function setRoles($roles)
  38. {
  39. $this->roles = $roles;
  40. }
  41. }