mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can check whether a group exists or not.
This commit is contained in:
		@@ -51,6 +51,22 @@ class GroupsComponent {
 | 
			
		||||
        return $groupID;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Check whether a group exists or not
 | 
			
		||||
     * 
 | 
			
		||||
     * @param int $id The ID of the target group
 | 
			
		||||
     * @return bool TRUE if the group exists / FALSE else
 | 
			
		||||
     */
 | 
			
		||||
    public function exists(int $id) : bool {
 | 
			
		||||
 | 
			
		||||
        return db()->count(
 | 
			
		||||
            self::GROUPS_LIST_TABLE,
 | 
			
		||||
            "WHERE id = ?",
 | 
			
		||||
            array($id)
 | 
			
		||||
        ) > 0;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get and return information about a group
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user