Commit 0c565339 authored by therealwa3er's avatar therealwa3er
Browse files

add function to verify if all subject frozen or not

parent 226f4233
......@@ -93,6 +93,38 @@ class UE extends AlecsiaEntity {
return $notes;
}
public function getFrozenAndNonFrozenNotes() {
$notes = array();
$notes['student'] = array();
$notes['group'] = array();
foreach ($this->sujets as $sujet) {
$notes_tp = $sujet->getNotes();
$notes['notes'][$sujet->getId()] = array();
$notes['sujet'][] = $sujet;
foreach ($notes_tp as $info) {
$notes['student'] += array($info['student']->getId() => $info['student']);
$notes['group'] += array($info['student']->getId() => $info['group']);
$notes['notes'][$sujet->getId()] += array($info['student']->getId() => $info['note']);
}
}
return $notes;
}
//retunr boolean
// check retun False if one subjet not frozen yet
public function isAllSujetFrozen(){
$frozen = true;
foreach ($this->sujets as $sujet) {
if (!$sujet->isFrozen()) {
$frozen = false;
}
}
return $frozen;
}
/* ============================== */
/* Right managements */
/* ============================== */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment