Permalink
Browse files

added or to id check for all with criteria searching

  • Loading branch information...
1 parent 7c976f5 commit 3e402135dc91fad1ab5d76e188147988dd6eb92d @jhirbour jhirbour committed Feb 1, 2013
Showing with 2 additions and 7 deletions.
  1. +2 −7 lib/ActiveResource/ActiveResource.php
@@ -247,18 +247,13 @@ public function find ($id = false, $options = array ()) {
if (count ($options) > 0) {
$options_string = '?' . http_build_query ($options);
}
- if ($id == 'all') {
+ if ($id == 'all' || $id == false) {
$url = $this->site . $this->element_name_plural . '.xml';
return $this->_send_and_receive ($url . $options_string, 'GET');
}
// URL/plural.xml?someparam=1
- if (! $id) {
- return $this->_send_and_receive ($this->site . $this->element_name_plural . '.xml' . $options_string, 'GET');
- }
- else {
- return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $id . '.xml' . $options_string, 'GET');
- }
+ return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $id . '.xml' . $options_string, 'GET');
}
/**

0 comments on commit 3e40213

Please sign in to comment.