Skip to content

Commit 2eb668f

Browse files
committed
Merge pull request #9 from continuousphp/master
added possibility to add query params to fetchAll()
2 parents 21f955f + 5ef777a commit 2eb668f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Service/Resource.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,18 @@ protected function getLastResponseHttpCode()
248248
}
249249

250250
/**
251+
* @param array $options The options to add to the query
251252
* @return array
252253
*/
253-
public function fetchAll()
254+
public function fetchAll($options = [])
254255
{
255-
$result = $this->request(self::ZOHO_API_ENDPOINT . $this->getPath());
256+
$url = self::ZOHO_API_ENDPOINT . $this->getPath();
257+
258+
if (!empty($options)) {
259+
$url .= '?' . http_build_query($options);
260+
}
261+
262+
$result = $this->request($url);
256263

257264
$collectionName = $this->getCollectionName();
258265
return $result[$collectionName];

0 commit comments

Comments
 (0)