mise a jour des gateways après modifs dans la classe mère

php
Anthony RICHARD 1 year ago
parent 412a7a7363
commit 0e0674539c

@ -4,6 +4,8 @@ namespace gateway;
use PDO;
use PDOException;
use config\Connection;
use model\Group;
class GroupGateway extends AbsGateway
{
@ -27,7 +29,7 @@ class GroupGateway extends AbsGateway
}
}
public function remove(array $id): void
public function remove(int $id): void
{
try{
$query = "DELETE FROM Group_ g WHERE g.id=:id ";

@ -261,4 +261,20 @@ class UserGateway extends AbsGateway
throw new Exception($e->getMessage());
}
}
public function findUsersByGroup(int $id): array {
try {
$query = "SELECT * FROM User_ WHERE groupID=:group";
$args = array(':group' => array($id, PDO::PARAM_INT));
$this->con->executeQuery($query, $args);
$results = $this->con->getResults();
$tab = array();
foreach ($results as $row)
$tab[] = new User($row['id'], $row['password'], $row['email'], $row['name'], $row['surname'], $row['nickname'], $row['image'], $row['extraTime'], $row['groupID'], $this->getRoles($row['id']));
return $tab;
}
catch(PDOException $e ){
throw new Exception($e->getMessage());
}
}
}

@ -28,7 +28,7 @@ class VocabularyGateway extends AbsGateway
}
}
public function remove(array $id): void
public function remove(int $id): void
{
try{
$query = "DELETE FROM Vocabulary v WHERE v.id=:id ";

Loading…
Cancel
Save