Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
14 / 14 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
Source | |
100.00% |
14 / 14 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
getEntityMapping | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
addConditionSource | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
postProcess | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace BO\Zmsdb\Query; |
4 | |
5 | class Source extends Base implements MappingInterface |
6 | { |
7 | /** |
8 | * @var String TABLE mysql table reference |
9 | */ |
10 | const TABLE = 'source'; |
11 | |
12 | public function getEntityMapping() |
13 | { |
14 | return [ |
15 | 'source' => 'source.source', |
16 | 'label' => 'source.label', |
17 | 'editable' => 'source.editable', |
18 | 'contact__name' => 'source.contact__name', |
19 | 'contact__email' => 'source.contact__email', |
20 | 'lastChange' => 'source.lastChange', |
21 | ]; |
22 | } |
23 | |
24 | public function addConditionSource($source) |
25 | { |
26 | $this->query->where('source.source', '=', $source); |
27 | return $this; |
28 | } |
29 | |
30 | public function postProcess($data) |
31 | { |
32 | $data[$this->getPrefixed("lastChange")] = |
33 | (new \DateTime($data[$this->getPrefixed("lastChange")] . \BO\Zmsdb\Connection\Select::$connectionTimezone)) |
34 | ->getTimestamp(); |
35 | return $data; |
36 | } |
37 | } |