mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Returns group visibility
This commit is contained in:
		@@ -273,6 +273,7 @@ class GroupsComponent {
 | 
			
		||||
        $info->set_name($data["name"]);
 | 
			
		||||
        $info->set_number_members($this->countMembers($info->get_id()));
 | 
			
		||||
        $info->set_membership_level($this->getMembershipLevel(userID, $info->get_id()));
 | 
			
		||||
        $info->set_visibility($data["visibility"]);
 | 
			
		||||
 | 
			
		||||
        if($data["path_logo"] != null && $data["path_logo"] != "" && $data["path_logo"] != "null")
 | 
			
		||||
            $info->set_logo($data["path_logo"]);
 | 
			
		||||
 
 | 
			
		||||
@@ -10,11 +10,17 @@ class GroupInfo extends BaseUniqueObject {
 | 
			
		||||
	//Path to group logo in user data
 | 
			
		||||
	const PATH_GROUPS_LOGO = "groups_logo";
 | 
			
		||||
 | 
			
		||||
	//Groups visibility
 | 
			
		||||
	const OPEN_GROUP = 0;
 | 
			
		||||
	const PRIVATE_GROUP = 1;
 | 
			
		||||
	const SECRET_GROUP = 2;
 | 
			
		||||
 | 
			
		||||
    //Private fields
 | 
			
		||||
    private $name;
 | 
			
		||||
    private $number_members = -1;
 | 
			
		||||
	private $logo;
 | 
			
		||||
	private $membership_level = -1;
 | 
			
		||||
	private $visiblity;
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    //Get and set the name of group
 | 
			
		||||
@@ -83,4 +89,17 @@ class GroupInfo extends BaseUniqueObject {
 | 
			
		||||
	public function get_membership_level() : int {
 | 
			
		||||
		return $this->membership_level;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	//Get and set group visibility
 | 
			
		||||
    public function set_visibility(int $visibility){
 | 
			
		||||
		$this->visibility = $visibility;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public function has_visibility() : bool {
 | 
			
		||||
		return $this->visibility > -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public function get_visibility() : int {
 | 
			
		||||
		return $this->visibility;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user