Data   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUserGroups() 0 9 1
1
<?php
2
3
/**
4
 * Data for members plugin
5
 *
6
 * PHP Version 5
7
 *
8
 * @category  Plugins
9
 * @package   Members
10
 * @author    Daniel Schalla <[email protected]>
11
 * @copyright 2013 cSphere Team
12
 * @license   http://opensource.org/licenses/bsd-license Simplified BSD License
13
 * @link      http://www.csphere.eu
14
 **/
15
16
namespace csphere\plugins\members\classes;
17
18
/**
19
 * Data for members plugin
20
 *
21
 * @category  Plugins
22
 * @package   Members
23
 * @author    Daniel Schalla <[email protected]>
24
 * @copyright 2013 cSphere Team
25
 * @license   http://opensource.org/licenses/bsd-license Simplified BSD License
26
 * @link      http://www.csphere.eu
27
 **/
28
29
class Data
30
{
31
    /**
32
     * Get all user groups the user is member of.
33
     *
34
     * @param int $userID the ID of a user
35
     *
36
     * @return array an array
37
     */
38
    public static function getUserGroups($userID)
39
    {
40
41
        $table = new \csphere\core\datamapper\Finder("members");
42
43
        $table->where("user_id", "=", $userID);
44
        $table->join("groups", "", "group_id");
45
        return $table->find(0, 0);
46
    }
47
}
48