Nextrek
Diff Revisions
604
vs
605
for /Android/SmartCharging/endPoints/get_commenti.php
|
@@ -24,11 +24,13 @@ |
24 |
24 |
|
$conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD); |
25 |
25 |
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
26 |
26 |
|
//echo "Connesso con successo al DB"; |
27 |
|
- |
|
|
27 |
+ |
|
28 |
28 |
|
$comment_repo = new CommentRepository($conn); |
29 |
29 |
|
|
|
30 |
+ |
$countComments = $comment_repo->countComments($params["id"]); |
30 |
31 |
|
$comments = $comment_repo->getComments($params["id"], $params["startIndex"], $params["length"]); |
31 |
32 |
|
|
|
33 |
+ |
$risposta["count"] = $countComments; |
32 |
34 |
|
$risposta["id"] = $params["id"]; |
33 |
35 |
|
$risposta["comments"] = $comments; |
34 |
36 |
|
|