Nextrek
Diff Revisions
537
vs
587
for /Android/SmartCharging/endPoints/nightly/repositories/CommentRepository.php
|
@@ -53,6 +53,17 @@ |
53 |
53 |
|
} |
54 |
54 |
|
} |
55 |
55 |
|
|
|
56 |
+ |
public function countComments($id_local) { |
|
57 |
+ |
$countQuery = "SELECT count(*) as count FROM commenti WHERE id_locale=".$id_local; |
|
58 |
+ |
try { |
|
59 |
+ |
$result = $this->db->query($countQuery); |
|
60 |
+ |
return (!$result || $result->rowCount()==0) ? 0 : $result->fetchColumn(); |
|
61 |
+ |
} catch (PDOException $e) { |
|
62 |
+ |
echo $e->getMessage(); |
|
63 |
+ |
return null; |
|
64 |
+ |
} |
|
65 |
+ |
} |
|
66 |
+ |
|
56 |
67 |
|
public function getComments($id_local, $start_index, $length) { |
57 |
68 |
|
/* query SQL da eseguire |
58 |
69 |
|
SELECT id_commento, id_locale, id_user, voto, descrizione, data, img |