Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Tm\UserBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use FOS\UserBundle\Model\User as BaseUser;
  7.  
  8. /**
  9. * @ORM\Table(name="utilisateur")
  10. * @ORM\Entity
  11. */
  12. class User extends BaseUser
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\Column(name="ID", type="integer")
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. protected $id;
  20.  
  21. public function addRole($role)
  22. {
  23. $role = strtoupper($role);
  24.  
  25. if (!in_array($role, $this->roles, true)) {
  26. $this->roles[] = $role;
  27. }
  28.  
  29. return $this;
  30. }
  31.  
  32. public function getId() {
  33. return $this->id;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement