X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fprofile.php;fp=classes%2Fprofile.php;h=7065598a0233c3245ece6425322fe9276cbbea12;hb=c96e6bd070c3bb50f7c95a91859af281ff88ba5b;hp=29de2b1f9b7f7ca91f4bb1e7ad9e9e392e39f264;hpb=c3d234916ceb4e8d400a624f61d2972c4259aa9b;p=platal.git diff --git a/classes/profile.php b/classes/profile.php index 29de2b1..7065598 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -1013,6 +1013,22 @@ class Profile implements PlExportable } } + /* Hobbies + */ + public function getHobbies() { + if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) { + return XDB::fetchAllAssoc('type', 'SELECT type, GROUP_CONCAT(text) + FROM profile_hobby + WHERE pid = {?} + GROUP BY type', $this->id()); + } else { + return XDB::fetchAllAssoc('type', 'SELECT type, GROUP_CONCAT(text) + FROM profile_hobby + WHERE pub = \'public\' AND pid = {?} + GROUP BY type', $this->id()); + } + } + /* Medals */ private $medals = null;