Can check whether a group exists or not.

This commit is contained in:
Pierre HUBERT 2018-07-04 06:12:15 +02:00
parent d6312f4b38
commit 0a3ae02bce

View File

@ -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
*