| Total Complexity | 12 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Coverage | 53.85% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class QueryBuilderOptions |
||
| 6 | { |
||
| 7 | const FILTER_AND = 'filters'; |
||
| 8 | |||
| 9 | const FILTER_OR = 'orFilters'; |
||
| 10 | |||
| 11 | private $options; |
||
| 12 | |||
| 13 | 28 | private function __construct(array $options) |
|
| 14 | { |
||
| 15 | 28 | $this->options = $options; |
|
| 16 | 28 | } |
|
| 17 | |||
| 18 | 28 | public static function fromArray(array $options) |
|
| 19 | { |
||
| 20 | 28 | return new self($options); |
|
| 21 | } |
||
| 22 | |||
| 23 | 15 | public function get($option, $defaultValue = null) |
|
| 33 | } |
||
| 34 | |||
| 35 | public function getAndFilters() |
||
| 36 | { |
||
| 37 | return $this->get(self::FILTER_AND, []); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getOrFilters() |
||
| 41 | { |
||
| 42 | return $this->get(self::FILTER_OR, []); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getSorting() |
||
| 46 | { |
||
| 47 | return $this->get('sorting', []); |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getRel() |
||
| 53 | } |
||
| 54 | |||
| 55 | public function getPrinting() |
||
| 58 | } |
||
| 59 | |||
| 60 | public function getSelect() |
||
| 61 | { |
||
| 62 | return $this->get('select'); |
||
| 63 | } |
||
| 64 | |||
| 65 | 2 | public function with($key, $value) |
|
| 70 | )); |
||
| 71 | } |
||
| 72 | } |
||
| 73 |