data = $data; // echo "

".var_dump($data)."

"; $userId = $data['listefiche'.$yunoshostFormId.'bf_nom']; $this->user = $entryManager->getOne($userId); // echo "

".var_dump($userId)."

"; $this->parents = []; foreach ($entryManager->search(['formsIds' => 9, 'queries' => ['listefiche7bf_eleve' => $userId]]) as $parent) { array_push($this->parents, new ParentEleve($entryManager, $yunoshostFormId, $parent)); } // echo "

".var_dump($this)."

"; } 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 getParentEmails() { $emails = []; foreach ($this->parents as $parent) { array_push($emails, $parent->getEmail()); } return $emails; } public function getData() { return $this->data; } public function isParent($username) { // echo "

username :".$username."

"; foreach ($this->parents as $parent) { // echo "

parent :".$parent->getUserId()."

"; if ($parent->getUserId() == $username) { return true; } } } }