@@ 30-41 (lines=12) @@ | ||
27 | * |
|
28 | * @return object |
|
29 | */ |
|
30 | public function getAll($dbConnection = NULL) |
|
31 | { |
|
32 | $connection = DatabaseQuery::checkConnection($dbConnection); |
|
33 | ||
34 | $sqlQuery = self::whereClause(); |
|
35 | $query = $connection->prepare($sqlQuery); |
|
36 | $query->execute(); |
|
37 | if ($query->rowCount()) { |
|
38 | return new GetData($query->fetchAll($connection::FETCH_ASSOC)); |
|
39 | } |
|
40 | throw new EmptyDatabaseException(); |
|
41 | } |
|
42 | ||
43 | /** |
|
44 | * where($data, $condition) |
@@ 392-403 (lines=12) @@ | ||
389 | * |
|
390 | * @return object |
|
391 | */ |
|
392 | public function query($query, $con = NULL) |
|
393 | { |
|
394 | $connection = self::checkConnection($con); |
|
395 | ||
396 | $query = $connection->prepare($query); |
|
397 | $query->execute(); |
|
398 | if ($query->rowCount()) |
|
399 | { |
|
400 | return new GetData($query->fetchAll($connection::FETCH_ASSOC)); |
|
401 | } |
|
402 | throw new DataNotFoundException(); |
|
403 | } |
|
404 | } |