From c159e50fcf553c438a11bfdbde5c73270ce95027 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 21 Feb 2010 01:52:13 +0100 Subject: [PATCH] Document the "visibility" concept, add isVisible to profiles MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/profile.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/classes/profile.php b/classes/profile.php index 79372e7..1e69288 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -213,6 +213,10 @@ class Profile return property_exists($this, $name) || isset($this->data[$name]); } + /** Sets the level of visibility of the profile + * Sets $this->visibility to a list of valid visibilities. + * @param one of the self::VISIBILITY_* values + */ public function setVisibilityLevel($visibility) { if ($visibility != self::VISIBILITY_PRIVATE @@ -226,6 +230,14 @@ class Profile } } + /** Determine whether an item with visibility $visibility can be displayed + * with the current level of visibility of the profile + * @param $visibility The level of visibility to be checked + */ + public function isVisible($visibility) + { + return in_array($visibility, $this->visibility); + } /* Photo */ -- 2.1.4