53 lines
No EOL
1.2 KiB
PHP
53 lines
No EOL
1.2 KiB
PHP
<?php
|
|
|
|
namespace YesWiki\Meeo\Eleve;
|
|
|
|
use YesWiki\Bazar\Service\EntryManager;
|
|
|
|
class Eleve {
|
|
private $data;
|
|
private $user;
|
|
|
|
public function __construct(EntryManager $entryManager, $yunoshostFormId, $data) {
|
|
$this->data = $data;
|
|
// echo "<p>".var_dump($data)."</p>";
|
|
$userId = $data['listefiche'.$yunoshostFormId.'Listebf_nom'];
|
|
$this->user = $entryManager->getOne($userId);
|
|
// echo "<p>".var_dump($this)."</p>";
|
|
}
|
|
|
|
public function getId() {
|
|
return $this->data['id_fiche'];
|
|
}
|
|
|
|
public function getUserId() {
|
|
return $this->user['bf_titre'];
|
|
}
|
|
|
|
public function getNom() {
|
|
if (empty($this->user['bf_nom'])) {
|
|
return $this->user['bf_titre'];
|
|
} else {
|
|
return $this->user['bf_nom'];
|
|
}
|
|
}
|
|
|
|
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 getEmail() {
|
|
return $this->user['bf_mail'];
|
|
}
|
|
|
|
public function getData() {
|
|
return $this->data;
|
|
}
|
|
} |