public function isAllowedToSee(ModelUser $user, $parameter) { if ($parameter instanceof ModelParameter) { $parameter = $parameter->getName(); } $profile = $user->getProfile(); if ($profile->getParameter($parameter)->getVisibility() == 'public') { return true; } elseif ($profile->getParameter($parameter)->getVisibility() == 'amis') { return $user->getUser_has_user($this)->checkType(ModelUser_has_user::FRIE); } else { return false; } }