1 | <?php |
||
11 | class PdoUserUuidRolesContainer implements ContainerInterface |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var \PDOStatement |
||
16 | */ |
||
17 | public $stmt; |
||
18 | |||
19 | |||
20 | /** |
||
21 | * @param \PDO $pdo PDO handler |
||
22 | * @param string $users_table Table name for users |
||
23 | * @param string $users_roles_table Table name for users-roles mapping |
||
24 | */ |
||
25 | public function __construct( \PDO $pdo, string $users_table, string $users_roles_table, string $roles_table ) |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Returns the user role names for a given user UUID. |
||
47 | * |
||
48 | * @param string $user_id User ID or UUID |
||
49 | * @return array |
||
50 | */ |
||
51 | public function __invoke( string $user_id ) |
||
59 | |||
60 | |||
61 | |||
62 | /** |
||
63 | * Alias for `get( $user_id )`, but throws NoUserRolesFoundException |
||
64 | * when no roles can be found. |
||
65 | * |
||
66 | * @inheritDoc |
||
67 | * @throws NoUserGroupsFoundException |
||
68 | */ |
||
69 | public function get( $user_id ) |
||
80 | |||
81 | |||
82 | /** |
||
83 | * @inheritDoc |
||
84 | */ |
||
85 | public function has( $user_id ) |
||
91 | } |
||
92 | |||
93 |