Skip to content
Snippets Groups Projects
Commit db001135 authored by Falko Trojahn's avatar Falko Trojahn
Browse files

#195 add @params option, default is like before. Redmine Rest API only...

#195 add @params option, default is like before. Redmine Rest API only mentions trackers, issue_categories, enabled_modules - but not attachments, relations. Keeping for backward compatibility
parent 7f140663
No related merge requests found
......@@ -70,15 +70,24 @@ class Project extends AbstractApi
/**
* Get extended information about a project (including memberships + groups).
*
* @see http://www.redmine.org/projects/redmine/wiki/Rest_Projects
* @see http://www.redmine.org/projects/redmine/wiki/Rest_Projects#Showing-a-project
*
* @param string $id the project id
* @param array $params available parameters:
* include: fetch associated data (optional). Possible values: trackers, issue_categories, enabled_modules (since 2.6.0)
*
* @return array information about the project
*/
public function show($id)
public function show($id, array $params = [])
{
return $this->get('/projects/'.urlencode($id).'.json?include=trackers,issue_categories,attachments,relations');
if (isset($params['include']) && is_array($params['include'])) {
$params['include'] = implode(',', $params['include']);
}
else {
$params['include'] = 'trackers,issue_categories,attachments,relations';
}
return $this->get('/projects/'.urlencode($id).'.json?'.http_build_query($params));
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment