From: Raphaël Barrois Date: Sun, 21 Feb 2010 00:52:13 +0000 (+0100) Subject: Document the "visibility" concept, add isVisible to profiles X-Git-Tag: xorg/1.0.0~332^2~124 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c159e50fcf553c438a11bfdbde5c73270ce95027;p=platal.git Document the "visibility" concept, add isVisible to profiles Signed-off-by: Raphaël Barrois --- 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 */