Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 19 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
Services | |
0.00% |
0 / 19 |
|
0.00% |
0 / 5 |
156 | |
0.00% |
0 / 1 |
containsLocation | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
getIds | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
getNames | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
getCSV | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
isLocale | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 |
1 | <?php |
2 | |
3 | /** |
4 | * @package Zmsdldb |
5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
6 | **/ |
7 | |
8 | namespace BO\Zmsdldb\Collection; |
9 | |
10 | class Services extends Base |
11 | { |
12 | public function containsLocation($locationCsv = null) |
13 | { |
14 | $list = new self(); |
15 | foreach ($this as $service) { |
16 | if ($service->containsLocation($locationCsv)) { |
17 | $list[] = $service; |
18 | } |
19 | } |
20 | return $list; |
21 | } |
22 | |
23 | public function getIds() |
24 | { |
25 | $idList = array(); |
26 | foreach ($this as $service) { |
27 | $idList[] = $service['id']; |
28 | } |
29 | return $idList; |
30 | } |
31 | |
32 | public function getNames() |
33 | { |
34 | $nameList = array(); |
35 | foreach ($this as $service) { |
36 | $nameList[$service['id']] = $service['name']; |
37 | } |
38 | return $nameList; |
39 | } |
40 | |
41 | public function getCSV() |
42 | { |
43 | return implode(',', $this->getIds()); |
44 | } |
45 | |
46 | public function isLocale($locale) |
47 | { |
48 | $list = new self(); |
49 | foreach ($this as $service) { |
50 | if ($service->isLocale($locale)) { |
51 | $list[] = $service; |
52 | } |
53 | } |
54 | return (count($list)) ? $list : null; |
55 | } |
56 | } |