| @@ 183-191 (lines=9) @@ | ||
| 180 | endif; |
|
| 181 | ||
| 182 | $sql = $this->selectSQL($this->selectCollumns) . ' ' . $this->whereSQL($filter) . ' ' . $option; |
|
| 183 | if ($this->pdo) { |
|
| 184 | $stmt = $this->pdo->prepare($sql); |
|
| 185 | $stmt->execute(array_values($filter)); |
|
| 186 | ||
| 187 | $results = $stmt->fetchAll(); |
|
| 188 | foreach ($results as $result): |
|
| 189 | $array[] = $this->mapObject($result); |
|
| 190 | endforeach; |
|
| 191 | } |
|
| 192 | return $array; |
|
| 193 | } |
|
| 194 | ||
| @@ 227-233 (lines=7) @@ | ||
| 224 | endif; |
|
| 225 | ||
| 226 | $sql = 'SELECT count(*) as total FROM ' . static::TABLE . ' ' . $this->whereSQL($filter); |
|
| 227 | if ($this->pdo) { |
|
| 228 | $stmt = $this->pdo->prepare($sql); |
|
| 229 | $stmt->execute(array_values($filter)); |
|
| 230 | ||
| 231 | $result = $stmt->fetch(); |
|
| 232 | $total = $result['total']; |
|
| 233 | } |
|
| 234 | return $total; |
|
| 235 | } |
|
| 236 | ||