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