mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-30 09:16:35 +00:00
Can check whether a group exists or not.
This commit is contained in:
parent
d6312f4b38
commit
0a3ae02bce
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user