1 | <?php |
||
28 | abstract class AbstractDaoService implements EntityRepo |
||
29 | { |
||
30 | /** |
||
31 | * @var \Minotaur\Acl\Gatekeeper |
||
32 | */ |
||
33 | protected $gatekeeper; |
||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $readPermission; |
||
38 | |||
39 | /** |
||
40 | * Creates a new AbstractDaoService. |
||
41 | * |
||
42 | * @param $gatekeeper - The security gatekeeper |
||
43 | * @param $readPermission - The ACL permission for read access |
||
44 | */ |
||
45 | public function __construct( |
||
52 | |||
53 | /** |
||
54 | * Gets the DAO. |
||
55 | * |
||
56 | * @return - The backing DAO |
||
|
|||
57 | */ |
||
58 | abstract protected function getDao(): EntityRepo; |
||
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | */ |
||
63 | public function getType(): string |
||
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | */ |
||
71 | public function countAll(array $criteria): int |
||
75 | |||
76 | /** |
||
77 | * @inheritDoc |
||
78 | */ |
||
79 | public function findOne(array $criteria) |
||
83 | |||
84 | /** |
||
85 | * @inheritDoc |
||
86 | */ |
||
87 | public function findAll(array $criteria, \Caridea\Http\Pagination $pagination = null, bool $totalCount = false): iterable |
||
91 | |||
92 | /** |
||
93 | * @inheritDoc |
||
94 | * @throws \Caridea\Acl\Exception\Forbidden If the user has no access |
||
95 | */ |
||
96 | public function findById($id) |
||
105 | |||
106 | /** |
||
107 | * @inheritDoc |
||
108 | * @throws \Caridea\Acl\Exception\Forbidden If the user has no access |
||
109 | */ |
||
110 | public function get($id) |
||
114 | |||
115 | /** |
||
116 | * @inheritDoc |
||
117 | * @throws \Caridea\Acl\Exception\Forbidden If the user has no access |
||
118 | */ |
||
119 | public function getAll(iterable $ids): iterable |
||
126 | |||
127 | /** |
||
128 | * @inheritDoc |
||
129 | */ |
||
130 | public function getInstanceMap(iterable $entities): array |
||
134 | |||
135 | /** |
||
136 | * Gets the entity and asserts an ACL permission. |
||
137 | * |
||
138 | * @param $id - The entity id |
||
139 | * @param $verb - The verb (e.g. 'read', 'write') |
||
140 | * @return - The entity |
||
141 | * @throws \Caridea\Dao\Exception\Unreachable If the connection fails |
||
142 | * @throws \Caridea\Dao\Exception\Unretrievable If the document doesn't exist |
||
143 | * @throws \Caridea\Dao\Exception\Generic If any other database problem occurs |
||
144 | * @throws \Caridea\Acl\Exception\Forbidden If the user has no access |
||
145 | */ |
||
146 | protected function getAndAssert($id, string $verb) |
||
153 | } |
||
154 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.