| 1 | <?php | ||
| 16 | class AnonymousUser | ||
| 17 | { | ||
| 18 | const DEFAULT_ID = 0; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * @var int | ||
| 22 | */ | ||
| 23 | private $id; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * @var string | ||
| 27 | */ | ||
| 28 | private $username = 'anonymous'; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * Constructor of the class. | ||
| 32 | */ | ||
| 33 | public function __construct() | ||
| 37 | |||
| 38 | /** | ||
| 39 | * Returns the username used to authenticate the user. | ||
| 40 | * | ||
| 41 | * @return string The username | ||
| 42 | */ | ||
| 43 | public function getUsername() | ||
| 44 |     { | ||
| 45 | return $this->username; | ||
| 46 | } | ||
| 47 | |||
| 48 | /** | ||
| 49 | * @param int $id id | ||
| 50 | * @return void | ||
| 51 | */ | ||
| 52 | public function setId($id) | ||
| 56 | |||
| 57 | /** | ||
| 58 | * @return int | ||
| 59 | */ | ||
| 60 | public function getId() | ||
| 64 | |||
| 65 | /** | ||
| 66 | * @return array | ||
| 67 | */ | ||
| 68 | public function getRoles() | ||
| 72 | } | ||
| 73 |