| @@ 82-91 (lines=10) @@ | ||
| 79 | * @param bool $pagination |
|
| 80 | * @return array |
|
| 81 | */ |
|
| 82 | protected function getFetchPaginationResult(array $objects, $pagination) |
|
| 83 | { |
|
| 84 | if ($pagination) { |
|
| 85 | $totalRowCount = $this->db->fetchValue('SELECT FOUND_ROWS()'); |
|
| 86 | ||
| 87 | return [$objects, $totalRowCount]; |
|
| 88 | } else { |
|
| 89 | return $objects; |
|
| 90 | } |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * Helper method to get pagination result as objects if pagination is requested. |
|
| @@ 100-108 (lines=9) @@ | ||
| 97 | * @param bool $pagination |
|
| 98 | * @return array |
|
| 99 | */ |
|
| 100 | protected function getDbEntitiesFromRowsPaginated(array $rows, $pagination) |
|
| 101 | { |
|
| 102 | if ($pagination) { |
|
| 103 | $totalRowCount = $this->db->fetchValue('SELECT FOUND_ROWS()'); |
|
| 104 | return [$this->getDbEntitiesFromRows($rows), $totalRowCount]; |
|
| 105 | } |
|
| 106 | ||
| 107 | return $this->getDbEntitiesFromRows($rows); |
|
| 108 | } |
|
| 109 | ||
| 110 | /** |
|
| 111 | * @param array $rows |
|