| Total Complexity | 14 |
| Total Lines | 199 |
| Duplicated Lines | 0 % |
| Coverage | 14.29% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Query |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var integer $limit |
||
| 11 | */ |
||
| 12 | protected $limit = 20; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var integer $offset |
||
| 16 | */ |
||
| 17 | protected $offset = 0; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var mixed $select |
||
| 21 | */ |
||
| 22 | protected $select = null; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var bool $withMeta |
||
| 26 | */ |
||
| 27 | protected $withMeta = false; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var bool $countTotal |
||
| 31 | */ |
||
| 32 | protected $countTotal = false; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var array $orderBy |
||
| 36 | */ |
||
| 37 | protected $orderBy; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var array $filter |
||
| 41 | */ |
||
| 42 | protected $filter; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Get $countTotal |
||
| 46 | * |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | public function isCountTotal(): bool |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Set $countTotal |
||
| 56 | * |
||
| 57 | * @return self |
||
| 58 | */ |
||
| 59 | public function countTotal() |
||
| 60 | { |
||
| 61 | $this->countTotal = true; |
||
| 62 | |||
| 63 | return $this; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Get $withMeta |
||
| 68 | * |
||
| 69 | * @return bool |
||
| 70 | */ |
||
| 71 | public function isWithMeta() |
||
| 72 | { |
||
| 73 | return $this->withMeta; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Set $withMeta |
||
| 78 | * |
||
| 79 | * @return self |
||
| 80 | */ |
||
| 81 | public function withMeta() |
||
| 82 | { |
||
| 83 | $this->withMeta = true; |
||
| 84 | |||
| 85 | return $this; |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Get $select |
||
| 90 | * |
||
| 91 | * @return mixed |
||
| 92 | */ |
||
| 93 | public function getSelect() |
||
| 94 | { |
||
| 95 | return $this->select; |
||
| 96 | } |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Set $select |
||
| 100 | * |
||
| 101 | * @param mixed $select |
||
| 102 | * |
||
| 103 | * @return self |
||
| 104 | */ |
||
| 105 | public function select($select) |
||
| 106 | { |
||
| 107 | $this->select = $select; |
||
| 108 | |||
| 109 | return $this; |
||
| 110 | } |
||
| 111 | |||
| 112 | /** |
||
| 113 | * Get $offset |
||
| 114 | * |
||
| 115 | * @return integer |
||
| 116 | */ |
||
| 117 | public function getOffset(): int |
||
| 118 | { |
||
| 119 | return $this->offset; |
||
| 120 | } |
||
| 121 | |||
| 122 | /** |
||
| 123 | * Set $offset |
||
| 124 | * |
||
| 125 | * @param integer $offset |
||
| 126 | * |
||
| 127 | * @return self |
||
| 128 | */ |
||
| 129 | public function offset(int $offset) |
||
| 130 | { |
||
| 131 | $this->offset = $offset; |
||
| 132 | |||
| 133 | return $this; |
||
| 134 | } |
||
| 135 | |||
| 136 | /** |
||
| 137 | * Get $limit |
||
| 138 | * |
||
| 139 | * @return integer |
||
| 140 | */ |
||
| 141 | public function getLimit(): int |
||
| 142 | { |
||
| 143 | return $this->limit; |
||
| 144 | } |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Set $limit |
||
| 148 | * |
||
| 149 | * @param integer $limit |
||
| 150 | * |
||
| 151 | * @return self |
||
| 152 | */ |
||
| 153 | public function limit(int $limit) |
||
| 154 | { |
||
| 155 | $this->limit = $limit; |
||
| 156 | |||
| 157 | return $this; |
||
| 158 | } |
||
| 159 | |||
| 160 | /** |
||
| 161 | * Get $orderBy |
||
| 162 | * |
||
| 163 | * @return array |
||
| 164 | */ |
||
| 165 | public function getOrderBy() |
||
| 166 | { |
||
| 167 | return $this->orderBy; |
||
| 168 | } |
||
| 169 | |||
| 170 | /** |
||
| 171 | * Set $orderBy |
||
| 172 | * |
||
| 173 | * @param array $orderBy $orderBy |
||
| 174 | * |
||
| 175 | * @return self |
||
| 176 | */ |
||
| 177 | public function orderBy(array $orderBy) |
||
| 178 | { |
||
| 179 | $this->orderBy = $orderBy; |
||
| 180 | |||
| 181 | return $this; |
||
| 182 | } |
||
| 183 | |||
| 184 | /** |
||
| 185 | * Get $filter |
||
| 186 | * |
||
| 187 | * @return array |
||
| 188 | */ |
||
| 189 | 6 | public function getWhere() |
|
| 192 | } |
||
| 193 | |||
| 194 | /** |
||
| 195 | * Set $filter |
||
| 196 | * |
||
| 197 | * @param array $filter $filter |
||
| 198 | * |
||
| 199 | * @return self |
||
| 200 | */ |
||
| 201 | 5 | public function where(array $filter) |
|
| 206 | } |
||
| 207 | } |
||
| 208 |