Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
Office
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
3 / 3
4
100.00% covered (success)
100.00%
1 / 1
 parseData
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
2
 fetchList
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 fetchPath
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * @package 115Mandant
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsdldb\File;
9
10use BO\Zmsdldb\Entity\Office as Entity;
11use BO\Zmsdldb\Collection\Offices as Collection;
12
13/**
14  * Common methods shared by access classes
15  *
16  */
17class Office extends Base
18{
19    /**
20     * @return Collection
21     */
22    #[\Override]
23    protected function parseData($data)
24    {
25        $itemList = new Collection();
26        foreach ($data['data']['office'] as $item) {
27            $itemList[$item['path']] = new Entity($item);
28            $itemList[$item['plural']] = $itemList[$item['path']];
29        }
30        return $itemList;
31    }
32
33    public function fetchList()
34    {
35        return $this->getItemList();
36    }
37
38    /** @psalm-api */
39    public function fetchPath($itemId)
40    {
41        return $this->fetchId($itemId);
42    }
43}