| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function getRoleByName($role_name = '') { |
||
| 23 | $options = array( |
||
| 24 | 'type' => 'object', |
||
| 25 | 'subtype' => 'role', |
||
| 26 | 'metadata_name_value_pairs' => array( |
||
| 27 | 'name' => 'name', |
||
| 28 | 'value' => $role_name, |
||
| 29 | 'operand' => '=', |
||
| 30 | ), |
||
| 31 | 'limit' => 1, |
||
| 32 | ); |
||
| 33 | $role_array = elgg_get_entities_from_metadata($options); |
||
| 34 | return $role_array ? $role_array[0] : false; |
||
| 35 | } |
||
| 36 | |||
| 67 |