| @@ 31-39 (lines=9) @@ | ||
| 28 | $this->limit = $limit; |
|
| 29 | } |
|
| 30 | ||
| 31 | public function buildQuery() |
|
| 32 | { |
|
| 33 | $whereClause = $this->buildWhere(); |
|
| 34 | $limitClause = $this->buildLimit(); |
|
| 35 | $query = "SELECT * FROM file f $whereClause ORDER BY f.updated_on DESC $limitClause"; |
|
| 36 | $parameters = $this->buildParameters(); |
|
| 37 | ||
| 38 | return [$query, $parameters]; |
|
| 39 | } |
|
| 40 | ||
| 41 | public function buildCount() |
|
| 42 | { |
|
| @@ 41-48 (lines=8) @@ | ||
| 38 | return [$query, $parameters]; |
|
| 39 | } |
|
| 40 | ||
| 41 | public function buildCount() |
|
| 42 | { |
|
| 43 | $whereClause = $this->buildWhere(); |
|
| 44 | $limitClause = $this->buildLimit(); |
|
| 45 | $query = "SELECT COUNT(*) FROM file f $whereClause ORDER BY f.updated_on DESC $limitClause"; |
|
| 46 | ||
| 47 | return [$query, $this->buildParameters()]; |
|
| 48 | } |
|
| 49 | ||
| 50 | private function buildWhere() |
|
| 51 | { |
|