engelsystem/includes/model/UserGroups_model.php

23 lines
419 B
PHP
Raw Normal View History

2014-08-23 01:55:18 +02:00
<?php
use Engelsystem\Database\DB;
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
{
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]
);
2014-08-23 01:55:18 +02:00
}