diff options
| author | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2024-01-23 07:41:52 +0000 |
|---|---|---|
| committer | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2024-01-23 07:41:52 +0000 |
| commit | 1728bc517691b3d0dde5ccdf0c0631ff1b855b6d (patch) | |
| tree | f3ad972dc584dc70c4817405d616558cc1a55061 /lib/models/Statusgruppen.php | |
| parent | 9750421a650a4e4980a1286212661a87eb92905b (diff) | |
Courseware Aufgaben erweitern (StEP3286)
Merge request studip/studip!2445
Diffstat (limited to 'lib/models/Statusgruppen.php')
| -rw-r--r-- | lib/models/Statusgruppen.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/models/Statusgruppen.php b/lib/models/Statusgruppen.php index e586110..e0d2575 100644 --- a/lib/models/Statusgruppen.php +++ b/lib/models/Statusgruppen.php @@ -740,4 +740,17 @@ class Statusgruppen extends SimpleORMap implements PrivacyObject } } } + + /** + * Checks if a user is a member of a group. + * + * @param string $user_id The user id + * @return boolean <b>true</b> if user is a member of this group + * + * @SuppressWarnings(PHPMD.StaticAccess) + */ + public static function isMemberOf(string $gruppenId, string $userId): bool + { + return StatusgruppeUser::countBySql('statusgruppe_id = ? AND user_id = ?', [$gruppenId, $userId]) !== 0; + } } |
