|
|
|
@ -1,6 +1,4 @@
|
|
|
|
|
<?php
|
|
|
|
|
namespace Gateway;
|
|
|
|
|
|
|
|
|
|
namespace Gateway;
|
|
|
|
|
use PDO;
|
|
|
|
|
|
|
|
|
@ -10,16 +8,14 @@ class CommentaryGateway {
|
|
|
|
|
$this->co = $co;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function create(commentaryEntity $c) :bool {
|
|
|
|
|
public function create(string $comment ,string $idUser, int $idQuote) :bool {
|
|
|
|
|
|
|
|
|
|
$query="INSERT INTO Commentary VALUES(:id_comment, :comment , :date, :idQuote, :idUser)";
|
|
|
|
|
$query="INSERT INTO Commentary(quote,users,datec,comment) VALUES(:idQuote, :idUser , CURRENT_DATE,:comment )";
|
|
|
|
|
|
|
|
|
|
return $this -> co -> executeQuery($query, array(
|
|
|
|
|
"id_comment" => array($c->getIdComment(), PDO::PARAM_INT),
|
|
|
|
|
"comment" => array($c->getComment(), PDO::PARAM_STR),
|
|
|
|
|
"idUser" => array($c->getUser(), PDO::PARAM_STR),
|
|
|
|
|
"idQuote" => array($id, PDO::PARAM_INT),
|
|
|
|
|
"date" => array($c->getDate(), PDO::PARAM_STR)));
|
|
|
|
|
"comment" => array($comment, PDO::PARAM_STR),
|
|
|
|
|
"idUser" => array($idUser, PDO::PARAM_STR),
|
|
|
|
|
"idQuote" => array($idQuote, PDO::PARAM_INT)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function findById(int $id) : array {
|
|
|
|
|