Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
Permission
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 3
20
0.00% covered (danger)
0.00%
0 / 1
 getEntityMapping
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 addConditionName
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 addConditionNames
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace BO\Zmsdb\Query;
4
5class Permission extends Base implements MappingInterface
6{
7    /**
8     * @var string TABLE mysql table reference
9     */
10    const TABLE = 'permission';
11
12    public function getEntityMapping()
13    {
14        return [
15            'id' => 'permission.id',
16            'name' => 'permission.name',
17            'description' => 'permission.description',
18        ];
19    }
20
21    public function addConditionName(string $name): self
22    {
23        $this->query->where('permission.name', '=', $name);
24        return $this;
25    }
26
27    public function addConditionNames(array $names): self
28    {
29        if ($names === []) {
30            throw new \InvalidArgumentException('Argument $names must not be empty.');
31        }
32        $this->query->whereIn('permission.name', $names);
33        return $this;
34    }
35}