modele de l'admin

php
Anthony RICHARD 1 year ago
parent 5e27236466
commit 52357b3635

@ -3,6 +3,7 @@
namespace model;
use config\Connection;
use gateway\GroupGateway;
use gateway\UserGateway;
class MdlAdmin extends AbsModel
@ -41,4 +42,23 @@ class MdlAdmin extends AbsModel
$gtw = new UserGateway(new Connection('mysql:host=localhost;dbname=dbanrichard7', 'anrichard7', 'achanger'));
return $gtw->findAllStudents();
}
public function removeUser(int $id): void {
$gtw = new UserGateway(new Connection('mysql:host=localhost;dbname=dbanrichard7', 'anrichard7', 'achanger'));
$gtw->remove($id);
}
public function showAllGroups(): array {
$gtw = new GroupGateway(new Connection('mysql:host=localhost;dbname=dbanrichard7', 'anrichard7', 'achanger'));
return $gtw->findAll();
}
public function getUsersOfGroup(int $id): array {
$gtw = new UserGateway(new Connection('mysql:host=localhost;dbname=dbanrichard7', 'anrichard7', 'achanger'));
return $gtw->findUsersByGroup($id);
}
public function removeUserFromGroup(int $id): void {
}
}
Loading…
Cancel
Save