eleve = $eleve; // echo var_dump($eleve); $listManager = $wiki->services->get(ListManager::class); $matieres = $listManager->getOne('ListeMatiere'); // echo "

".var_dump($matieres)."

"; foreach ($matieres['nodes'] as $matiere) { $this->matieres[] = new Matiere($wiki, $this, $matiere["id"], $matiere["label"]); } } public function getId() { return $this->eleve->getId(); } public function getNom() { return $this->eleve->getNom(); } public function getClasse() { return $this->eleve->getClasse(); } public function getMoyenne() { $total = 0; $totalMatieres = 0; foreach ( $this->matieres as $matiere) { if ($matiere->isVisible()) { $total += $matiere->getMoyenne(); ++$totalMatieres; } } return $total / $totalMatieres; } public function getMatieres() { return $this->matieres; } public function isVisible() { foreach ($this->matieres as $matiere) { if ( $matiere->isVisible() ) { return true; } return false; } } }