Permalink
Browse files

Allow multiple parameters and clean up the way we go about handling d…

…efault fields.
  • Loading branch information...
1 parent 49d18d7 commit e4865dd3643a74f5450c609039e55740d863dbdd @brandonsavage brandonsavage committed Sep 19, 2012
Showing with 18 additions and 2 deletions.
  1. +18 −2 BugzillaQuery.class.php
View
@@ -191,7 +191,11 @@ function __construct($type, $options, $title='') {
public function _fetch_by_options() {
// Set up our HTTP request
- $request = new HTTP_Request2($this->url,
+ $options_array = array();
+
+ $options_array = array(Net_Url2::OPTION_USE_BRACKETS => false);
+ $net_url2 = new Net_Url2($this->url, $options_array);
+ $request = new HTTP_Request2($net_url2,
HTTP_Request2::METHOD_GET,
array('follow_redirects' => TRUE,
// TODO: Not sure if I should do this
@@ -203,13 +207,25 @@ public function _fetch_by_options() {
// Save the real options
$saved_options = $this->options;
-
+
+ if(!isset($this->options['include_fields'])) {
+ $this->options['include_fields'] = array();
+ }
+
+ if(!is_array($this->options['include_fields'])) {
+ (array)$this->options['include_fields'];
+ }
+
// Add any synthetic fields to the options
if( !empty($this->synthetic_fields) ) {
$this->options['include_fields'] =
@array_merge((array)$this->options['include_fields'],
$this->synthetic_fields);
}
+
+ if(!empty($this->options['include_fields'])) {
+ $this->options['include_fields'] = implode(",", $this->options['include_fields']);
+ }
// Add the requested query options to the request
$url = $request->getUrl();

0 comments on commit e4865dd

Please sign in to comment.