2014-08-23 01:55:18 +02:00
|
|
|
<?php
|
|
|
|
|
2021-11-30 23:29:51 +01:00
|
|
|
use Engelsystem\Database\Db;
|
2017-01-21 13:58:53 +01:00
|
|
|
|
2014-08-23 01:55:18 +02:00
|
|
|
/**
|
|
|
|
* Returns users groups
|
2017-01-02 15:43:36 +01:00
|
|
|
*
|
2018-10-09 21:47:31 +02:00
|
|
|
* @param int $userId
|
2017-12-25 23:12:52 +01:00
|
|
|
* @return array[]
|
2014-08-23 01:55:18 +02:00
|
|
|
*/
|
2018-10-09 21:47:31 +02:00
|
|
|
function User_groups($userId)
|
2017-01-02 03:57:23 +01:00
|
|
|
{
|
2022-06-16 22:50:52 +02:00
|
|
|
return Db::select('
|
2020-05-13 18:26:32 +02:00
|
|
|
SELECT `Groups`.*
|
|
|
|
FROM `UserGroups`
|
|
|
|
JOIN `Groups` ON `Groups`.`UID`=`UserGroups`.`group_id`
|
|
|
|
WHERE `UserGroups`.`uid`=?
|
|
|
|
ORDER BY `UserGroups`.`group_id`
|
|
|
|
',
|
2018-10-09 21:47:31 +02:00
|
|
|
[$userId]
|
2017-01-21 13:58:53 +01:00
|
|
|
);
|
2014-08-23 01:55:18 +02:00
|
|
|
}
|