ynh_extension_meeo/libs/eleves/eleve.lib.php

51 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace YesWiki\Meeo\Eleve;
use YesWiki\Bazar\Service\EntryManager;
class Eleve {
2024-07-27 13:22:09 +00:00
private $data;
private $user;
public function __construct(EntryManager $entryManager, $data) {
$this->data = $data;
2024-07-27 13:22:09 +00:00
// echo "<p>".var_dump($data)."</p>";
//TODO récupérer le bon numéro de liste
if (empty($data['listefiche5Listebf_nom']))
$userId = $data['listefichebf_nom'];
else
$userId = $data['listefiche5Listebf_nom'];
$this->user = $entryManager->getOne($userId);
// echo "<p>".var_dump($this)."</p>";
}
public function getId() {
return $this->data['id_fiche'];
}
public function getNom() {
if (empty($this->user['bf_nom'])) {
return $this->user['bf_titre'];
} else {
return $this->user['bf_nom'];
}
}
2024-07-27 13:22:09 +00:00
public function getClasse() {
if (empty($this->data['listeListeClassesbf_classe'])) {
return $this->data['bf_classe'];
}
return $this->data['listeListeClassesbf_classe'];
}
public function setClasse(string $classe) {
$this->data['listeListeClassesbf_classe'] = $classe;
}
public function getData() {
return $this->data;
}
}