You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ScienceQuest/project/src/model/mdl/MdlDifficulte.php

25 lines
626 B

<?php
namespace model;
class MdlDifficulte extends MdlBase{
private DifficulteGateway $gw;
public function __construct(){
parent::__construct();
$this->gw = new DifficulteGateway($this->con);
}
public function getAll(): array{
$listDifficulte = [];
foreach($this->gw->getAll() as $row){
$listDifficulte[] = new Difficulte($row['id'], $row['libelle']);
}
return $listDifficulte;
}
public function getFromId(int $id): Difficulte{
$row = $this->gw->getFromId($id);
return new Difficulte($row['id'], $row['libelle']);
}
}