public function setVisibility($visibility) { if (!in_array($visibility, array(self::VISIBILITY_PROTECTED, self::VISIBILITY_PUBLIC))) { throw new \InvalidArgumentException("Invalid visibility"); } $this->visibility = $visibility; return $this; }