Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
16 / 16 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| Apikey | |
100.00% |
16 / 16 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| addRequiredJoins | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| getEntityMapping | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| addConditionApikey | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdb\Query; |
| 4 | |
| 5 | /** |
| 6 | * @SuppressWarnings(Public) |
| 7 | */ |
| 8 | class 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 | protected function addRequiredJoins() |
| 18 | { |
| 19 | $this->leftJoin( |
| 20 | new Alias('apiclient', 'apiclientkey'), |
| 21 | 'apikey.apiClientID', |
| 22 | '=', |
| 23 | 'apiclientkey.apiClientID' |
| 24 | ); |
| 25 | } |
| 26 | |
| 27 | |
| 28 | public function getEntityMapping() |
| 29 | { |
| 30 | $mapping = [ |
| 31 | 'key' => 'apikey.key', |
| 32 | 'createIP' => 'apikey.createIP', |
| 33 | 'apiclient__clientKey' => 'apiclientkey.clientKey', |
| 34 | 'apiclient__accesslevel' => 'apiclientkey.accesslevel', |
| 35 | 'ts' => 'apikey.ts' |
| 36 | ]; |
| 37 | return $mapping; |
| 38 | } |
| 39 | |
| 40 | public function addConditionApikey($apikey) |
| 41 | { |
| 42 | $this->query->where('apikey.key', '=', $apikey); |
| 43 | return $this; |
| 44 | } |
| 45 | } |