| Total Complexity | 14 |
| Total Lines | 203 |
| Duplicated Lines | 0 % |
| 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 |
||
| 50 | { |
||
| 51 | return $this->countTotal; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Set $countTotal |
||
| 56 | * |
||
| 57 | * @param bool $countTotal |
||
| 58 | * |
||
| 59 | * @return self |
||
| 60 | */ |
||
| 61 | public function countTotal(bool $countTotal) |
||
| 62 | { |
||
| 63 | $this->countTotal = $countTotal; |
||
| 64 | |||
| 65 | return $this; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Get $withMeta |
||
| 70 | * |
||
| 71 | * @return bool |
||
| 72 | */ |
||
| 73 | public function isWithMeta() |
||
| 74 | { |
||
| 75 | return $this->withMeta; |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Set $withMeta |
||
| 80 | * |
||
| 81 | * @param bool $withMeta |
||
| 82 | * |
||
| 83 | * @return self |
||
| 84 | */ |
||
| 85 | public function withMeta(bool $withMeta) |
||
| 86 | { |
||
| 87 | $this->withMeta = $withMeta; |
||
| 88 | |||
| 89 | return $this; |
||
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * Get $select |
||
| 94 | * |
||
| 95 | * @return mixed |
||
| 96 | */ |
||
| 97 | public function getSelect() |
||
| 98 | { |
||
| 99 | return $this->select; |
||
| 100 | } |
||
| 101 | |||
| 102 | /** |
||
| 103 | * Set $select |
||
| 104 | * |
||
| 105 | * @param mixed $select |
||
| 106 | * |
||
| 107 | * @return self |
||
| 108 | */ |
||
| 109 | public function select($select) |
||
| 110 | { |
||
| 111 | $this->select = $select; |
||
| 112 | |||
| 113 | return $this; |
||
| 114 | } |
||
| 115 | |||
| 116 | /** |
||
| 117 | * Get $offset |
||
| 118 | * |
||
| 119 | * @return integer |
||
| 120 | */ |
||
| 121 | public function getOffset(): int |
||
| 122 | { |
||
| 123 | return $this->offset; |
||
| 124 | } |
||
| 125 | |||
| 126 | /** |
||
| 127 | * Set $offset |
||
| 128 | * |
||
| 129 | * @param integer $offset |
||
| 130 | * |
||
| 131 | * @return self |
||
| 132 | */ |
||
| 133 | public function offset(int $offset) |
||
| 134 | { |
||
| 135 | $this->offset = $offset; |
||
| 136 | |||
| 137 | return $this; |
||
| 138 | } |
||
| 139 | |||
| 140 | /** |
||
| 141 | * Get $limit |
||
| 142 | * |
||
| 143 | * @return integer |
||
| 144 | */ |
||
| 145 | public function getLimit(): int |
||
| 146 | { |
||
| 147 | return $this->limit; |
||
| 148 | } |
||
| 149 | |||
| 150 | /** |
||
| 151 | * Set $limit |
||
| 152 | * |
||
| 153 | * @param integer $limit |
||
| 154 | * |
||
| 155 | * @return self |
||
| 156 | */ |
||
| 157 | public function limit(int $limit) |
||
| 158 | { |
||
| 159 | $this->limit = $limit; |
||
| 160 | |||
| 161 | return $this; |
||
| 162 | } |
||
| 163 | |||
| 164 | /** |
||
| 165 | * Get $orderBy |
||
| 166 | * |
||
| 167 | * @return array |
||
| 168 | */ |
||
| 169 | public function getOrderBy() |
||
| 170 | { |
||
| 171 | return $this->orderBy; |
||
| 172 | } |
||
| 173 | |||
| 174 | /** |
||
| 175 | * Set $orderBy |
||
| 176 | * |
||
| 177 | * @param array $orderBy $orderBy |
||
| 178 | * |
||
| 179 | * @return self |
||
| 180 | */ |
||
| 181 | public function orderBy(array $orderBy) |
||
| 182 | { |
||
| 183 | $this->orderBy = $orderBy; |
||
| 184 | |||
| 185 | return $this; |
||
| 186 | } |
||
| 187 | |||
| 188 | /** |
||
| 189 | * Get $filter |
||
| 190 | * |
||
| 191 | * @return array |
||
| 192 | */ |
||
| 193 | public function getWhere() |
||
| 196 | } |
||
| 197 | |||
| 198 | /** |
||
| 199 | * Set $filter |
||
| 200 | * |
||
| 201 | * @param array $filter $filter |
||
| 202 | * |
||
| 203 | * @return self |
||
| 204 | */ |
||
| 205 | public function where(array $filter) |
||
| 210 | } |
||
| 211 | } |
||
| 212 |