Skip to content

Commit

Permalink
modify find() method to enable options string in cases where != 'all'
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonrampton committed Jun 17, 2012
1 parent 4446417 commit 0a25e2c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ActiveResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,15 @@ function find ($id = false, $options = array ()) {
if (! $id) {
$id = $this->_data['id'];
}
$options_string = '';
if (count($options) > 0) {
$options_string = '?' . http_build_query ($options);
}
if ($id == 'all') {
$url = $this->site . $this->element_name_plural . '.xml';
if (count ($options) > 0) {
$url .= '?' . http_build_query ($options);
}
return $this->_send_and_receive ($url, 'GET');
return $this->_send_and_receive ($url . $options_string, 'GET');
}
return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $id . '.xml', 'GET');
return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $id . '.xml' . $options_string, 'GET');
}

/**
Expand Down

0 comments on commit 0a25e2c

Please sign in to comment.