| Total Complexity | 3 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | abstract class ListOfValues implements CriteriaInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $values; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * ListOfValues constructor. |
||
| 21 | * |
||
| 22 | * @param string $valueList Comma separated sting of values |
||
| 23 | */ |
||
| 24 | 1 | final public function __construct($valueList) |
|
| 25 | { |
||
| 26 | 1 | $this->values = explode(',', $valueList); |
|
| 27 | 1 | } |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Returns field name in schema |
||
| 31 | * |
||
| 32 | * @return mixed |
||
| 33 | */ |
||
| 34 | abstract protected function getField(): string; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | 1 | public function getValues(): array |
|
| 40 | { |
||
| 41 | 1 | return $this->values; |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param Builder $model |
||
| 46 | * @param RepositoryInterface $repository |
||
| 47 | * |
||
| 48 | * @return Builder |
||
| 49 | */ |
||
| 50 | 1 | public function apply($model, RepositoryInterface $repository): Builder |
|
| 55 | } |
||
| 56 | } |
||
| 57 |