Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
Apikey
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 addRequiredJoins
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
 getEntityMapping
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
1 / 1
1
 addConditionApikey
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace BO\Zmsdb\Query;
4
5/**
6 * @SuppressWarnings(Public)
7 */
8class Apikey extends Base implements MappingInterface
9{
10    /**
11     * @var String TABLE mysql table reference
12     */
13    const TABLE = 'apikey';
14
15    const QUOTATABLE = 'apiquota';
16
17    #[\Override]
18    protected function addRequiredJoins()
19    {
20        $this->leftJoin(
21            new Alias('apiclient', 'apiclientkey'),
22            'apikey.apiClientID',
23            '=',
24            'apiclientkey.apiClientID'
25        );
26    }
27
28
29    #[\Override]
30    public function getEntityMapping()
31    {
32        $mapping = [
33            'key' => 'apikey.key',
34            'createIP' => 'apikey.createIP',
35            'apiclient__clientKey' => 'apiclientkey.clientKey',
36            'apiclient__accesslevel' => 'apiclientkey.accesslevel',
37            'ts' => 'apikey.ts'
38        ];
39        return $mapping;
40    }
41
42    public function addConditionApikey($apikey)
43    {
44        $this->query->where('apikey.key', '=', $apikey);
45        return $this;
46    }
47}