public function setCreditEctsGlobal($mention_ects) { $credit = $this->getCreditEctsGlobal(); if ($credit == null) { $credit = new CreditEctsGlobal(); $credit->setEleve($this); } $credit->setMention($mention_ects); return $credit->save(); }