1 | <?php |
||
16 | class User extends AbstractViewHelper |
||
17 | { |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $entity = ''; |
||
21 | |||
22 | /** |
||
23 | * Initialize |
||
24 | * |
||
25 | * @param string $entity |
||
26 | * |
||
27 | * @return $this |
||
28 | */ |
||
29 | public function __invoke(string $entity = '') |
||
34 | |||
35 | /** |
||
36 | * Check if user is logged in |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function isLoggedIn() |
||
44 | |||
45 | /** |
||
46 | * Get user entity |
||
47 | * |
||
48 | * @return Entity |
||
49 | */ |
||
50 | public function get() |
||
56 | |||
57 | /** |
||
58 | * Check if user has one of given roles |
||
59 | * |
||
60 | * @param array $roles |
||
61 | * |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function isPermitted(array $roles) |
||
71 | |||
72 | } |