File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ public function getGroups()
43
43
* @return mixed HTTP return code and API return object
44
44
*/
45
45
46
- public function getGroup ($ group )
46
+ public function getGroup ($ groupname )
47
47
{
48
- return $ this ->_getRequest ('/groups/ ' . $ group . '.json ' );
48
+ return $ this ->_getRequest ('/groups/ ' . $ groupname . '.json ' );
49
49
}
50
50
51
51
/**
@@ -79,20 +79,12 @@ public function joinGroup($groupname, $username)
79
79
*/
80
80
public function getGroupIdByGroupName ($ groupname )
81
81
{
82
- $ obj = $ this ->getGroups ( );
82
+ $ obj = $ this ->getGroup ( $ groupname );
83
83
if ($ obj ->http_code !== 200 ) {
84
84
return false ;
85
85
}
86
86
87
- foreach ($ obj ->apiresult as $ group ) {
88
- if ($ group ->name === $ groupname ) {
89
- $ groupId = (int )$ group ->id ;
90
- break ;
91
- }
92
- $ groupId = false ;
93
- }
94
-
95
- return $ groupId ;
87
+ return $ obj ->apiresult ->group ->id ;
96
88
}
97
89
98
90
/**
You can’t perform that action at this time.
0 commit comments