Lines 100.00% 7 / 7
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
RequestVariant 100.00% 7 / 7 100.00% 1 / 1 2 100.00% 1 / 1
 readAll 100.00% 7 / 7 100.00% 1 / 1 2
1<?php
2
3namespace BO\Zmsbackend\RequestVariant\Service;
4
5class RequestVariant extends \BO\Zmsbackend\Base
6{
7    public function readAll(): array
8    {
9        $q = new \BO\Zmsbackend\RequestVariant\Repository\RequestVariant(\BO\Zmsbackend\Query\Base::SELECT);
10        $q->addEntityMapping()->orderByName();
11        $stmt = $this->fetchStatement($q);
12        $out = [];
13        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
14            $out[] = ['id' => (int)$row['id'], 'name' => $row['name']];
15        }
16        return $out;
17    }
18}