1 | <?php |
||
22 | class SecurityRightDao implements RightsDaoInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var TDBMService |
||
26 | */ |
||
27 | protected $tdbmService; |
||
28 | |||
29 | /** |
||
30 | * The list of all supported rights in the application. |
||
31 | * |
||
32 | * @var RightsRegistry |
||
33 | */ |
||
34 | protected $rightsRegistry; |
||
35 | |||
36 | /** |
||
37 | * @param TDBMService $tdbmService Sets the TDBM service used by this DAO. |
||
38 | * @param RightsRegistry $rightsRegistry The list of all supported rights in the application. |
||
39 | */ |
||
40 | public function __construct(TDBMService $tdbmService, RightsRegistry $rightsRegistry) |
||
45 | |||
46 | /** |
||
47 | * Returns a list of all the rights for the user passed in parameter. |
||
48 | * |
||
49 | * @param string $user_id |
||
50 | * |
||
51 | * @return array<RightInterface> |
||
52 | */ |
||
53 | public function getRightsForUser($user_id) |
||
68 | |||
69 | /** |
||
70 | * Returns the RightInterface object associated to the user (or null if the |
||
71 | * user has no such right). |
||
72 | * |
||
73 | * @param string $user_id |
||
74 | * @param string $right |
||
75 | * |
||
76 | * @return RightInterface |
||
77 | */ |
||
78 | public function getRightForUser($user_id, $right) |
||
93 | |||
94 | /** |
||
95 | * Get a list of RolesRightBean specified by its filters. |
||
96 | * |
||
97 | * @param mixed $filter The filter bag (see TDBMService::findObjects for complete description) |
||
98 | * @param array $parameters The parameters associated with the filter |
||
99 | * @param mixed $orderBy The order string |
||
100 | * @param array $additionalTablesFetch A list of additional tables to fetch (for performance improvement) |
||
101 | * @param int $mode Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY. |
||
102 | * |
||
103 | * @return RolesRightBean[]|ResultIterator|ResultArray |
||
104 | */ |
||
105 | private function find($filter = null, array $parameters = [], $orderBy = null, array $additionalTablesFetch = [], $mode = null) |
||
109 | |||
110 | /** |
||
111 | * Get a single RolesRightBean specified by its filters. |
||
112 | * |
||
113 | * @param mixed $filter The filter bag (see TDBMService::findObjects for complete description) |
||
114 | * @param array $parameters The parameters associated with the filter |
||
115 | * |
||
116 | * @return RolesRightBean |
||
117 | */ |
||
118 | private function findOne($filter = null, array $parameters = []) |
||
122 | } |
||
123 |