Lines 100.00% 9 / 9
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
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
3namespace BO\Zmsbackend\Permission\Service;
4
5use BO\Zmsentities\Collection\PermissionList as Collection;
6use BO\Zmsentities\Permission as Entity;
7
8class Permission extends \BO\Zmsbackend\Base
9{
10    public function readAllPermissions(string $order = 'ASC'): Collection
11    {
12        $list = new Collection();
13        $query = new \BO\Zmsbackend\Permission\Repository\Permission(\BO\Zmsbackend\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}