Permalink
Browse files

modify find() method to enable options string in cases where != 'all'

  • Loading branch information...
1 parent 4446417 commit 0a25e2cd0e853db803ad3a0107ee3c6e4aac1d4f @sheldonrampton sheldonrampton committed Jun 17, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 ActiveResource.php
View
@@ -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');
}
/**

0 comments on commit 0a25e2c

Please sign in to comment.