| @@ 191-210 (lines=20) @@ | ||
| 188 | * |
|
| 189 | * @return array |
|
| 190 | */ |
|
| 191 | public function fetchAllArray() |
|
| 192 | { |
|
| 193 | // init |
|
| 194 | $data = array(); |
|
| 195 | ||
| 196 | if ( |
|
| 197 | $this->_result |
|
| 198 | && |
|
| 199 | !$this->is_empty() |
|
| 200 | ) { |
|
| 201 | $this->reset(); |
|
| 202 | ||
| 203 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 204 | while ($row = \mysqli_fetch_assoc($this->_result)) { |
|
| 205 | $data[] = $this->cast($row); |
|
| 206 | } |
|
| 207 | } |
|
| 208 | ||
| 209 | return $data; |
|
| 210 | } |
|
| 211 | ||
| 212 | /** |
|
| 213 | * Fetch all results as "Arrayy"-object. |
|
| @@ 217-236 (lines=20) @@ | ||
| 214 | * |
|
| 215 | * @return Arrayy |
|
| 216 | */ |
|
| 217 | public function fetchAllArrayy() |
|
| 218 | { |
|
| 219 | // init |
|
| 220 | $data = array(); |
|
| 221 | ||
| 222 | if ( |
|
| 223 | $this->_result |
|
| 224 | && |
|
| 225 | !$this->is_empty() |
|
| 226 | ) { |
|
| 227 | $this->reset(); |
|
| 228 | ||
| 229 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 230 | while ($row = \mysqli_fetch_assoc($this->_result)) { |
|
| 231 | $data[] = $this->cast($row); |
|
| 232 | } |
|
| 233 | } |
|
| 234 | ||
| 235 | return Arrayy::create($data); |
|
| 236 | } |
|
| 237 | ||
| 238 | /** |
|
| 239 | * Check if the result is empty. |
|