| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function getUserRole(\ElggUser $user) { |
||
| 41 | $options = array( |
||
| 42 | 'type' => 'object', |
||
| 43 | 'subtype' => 'role', |
||
| 44 | 'relationship' => 'has_role', |
||
| 45 | 'relationship_guid' => $user->guid, |
||
| 46 | 'limit' => 1, |
||
| 47 | ); |
||
| 48 | $roles = elgg_get_entities_from_relationship($options); |
||
| 49 | return $roles ? $roles[0] : false; |
||
| 50 | } |
||
| 51 | |||
| 67 |