From: Raphaël Barrois Date: Fri, 19 Mar 2010 23:11:33 +0000 (+0100) Subject: Add Medals field to profile X-Git-Tag: xorg/1.0.0~332^2~34 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=26ca919b568e94e5b974e791bac4f4a88401c64b;p=platal.git Add Medals field to profile Signed-off-by: Raphaël Barrois --- diff --git a/classes/profile.php b/classes/profile.php index 8af99ab..032c61a 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -482,6 +482,24 @@ class Profile WHERE pid = {?}', $this->id()); } + /* Medals + */ + private $medals = null; + public function setMedals(ProfileMedals $medals) + { + $this->medals = $medals; + } + + public function getMedals() + { + if ($this->medals == null) { + $this->setMedals($this->getProfileField('ProfileMedals')); + } + if ($this->medals == null) { + return array(); + } + return $this->medals->medals; + } public function owner() { @@ -831,7 +849,7 @@ class ProfileIterator implements PlIterator $pf->setCorps($vals[Profile::FETCH_CORPS]); } if ($this->hasData(Profile::FETCH_EDU, $vals)) { - $pf->setEdu($vals[Profile::FETCH_EDU]); + $pf->setEducations($vals[Profile::FETCH_EDU]); } if ($this->hasData(Profile::FETCH_MEDALS, $vals)) { $pf->setMedals($vals[Profile::FETCH_MEDALS]);