Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Permission | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| readAllPermissions | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdb; |
| 4 | |
| 5 | use BO\Zmsentities\Collection\PermissionList as Collection; |
| 6 | use BO\Zmsentities\Permission as Entity; |
| 7 | |
| 8 | class Permission extends Base |
| 9 | { |
| 10 | public function readAllPermissions(string $order = 'ASC'): Collection |
| 11 | { |
| 12 | $list = new Collection(); |
| 13 | $query = new Query\Permission(Query\Base::SELECT); |
| 14 | $query->addEntityMapping() |
| 15 | ->addResolvedReferences(0) |
| 16 | ->addOrderByName($order); |
| 17 | $result = $this->fetchList($query, new Entity()); |
| 18 | foreach ($result as $entity) { |
| 19 | $list->addEntity($entity); |
| 20 | } |
| 21 | return $list; |
| 22 | } |
| 23 | } |