Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added page and per_page options

  • Loading branch information...
commit 0be32a12ec45b09471e72e1c8d993b0fe07f44eb 1 parent ff27f5f
@thousandsofthem thousandsofthem authored
View
3  .gitignore
@@ -9,4 +9,5 @@ tmp/
.DS_Store
*.esproj/
.idea/
-config.ini
+config.ini
+/__*
View
32 IronWorker.class.php
@@ -6,7 +6,7 @@
* @link https://github.com/iron-io/iron_worker_php
* @link http://www.iron.io/
* @link http://dev.iron.io/
- * @version 1.3.0
+ * @version 1.3.1
* @package IronWorkerPHP
* @copyright Feel free to copy, steal, take credit for, or whatever you feel like doing with this code. ;)
*/
@@ -176,10 +176,14 @@ public function getProjects(){
return $projects->projects;
}
- public function getTasks(){
+ public function getTasks($page = 0, $per_page = 30){
$url = "projects/{$this->project_id}/tasks";
$this->setJsonHeaders();
- $task = self::json_decode($this->apiCall(self::GET, $url));
+ $params = array(
+ 'page' => $page,
+ 'per_page' => $per_page
+ );
+ $task = self::json_decode($this->apiCall(self::GET, $url, $params));
return $task->tasks;
}
@@ -189,10 +193,14 @@ public function getProjectDetails(){
return json_decode($this->apiCall(self::GET, $url));
}
- public function getCodes(){
- $this->setJsonHeaders();
+ public function getCodes($page = 0, $per_page = 30){
$url = "projects/{$this->project_id}/codes";
- $codes = self::json_decode($this->apiCall(self::GET, $url));
+ $this->setJsonHeaders();
+ $params = array(
+ 'page' => $page,
+ 'per_page' => $per_page
+ );
+ $codes = self::json_decode($this->apiCall(self::GET, $url, $params));
return $codes->codes;
}
@@ -261,12 +269,18 @@ public function deleteSchedule($schedule_id){
/**
* Get information about all schedules for project
*
+ * @param int $page
+ * @param int $per_page
* @return mixed
*/
- public function getSchedules(){
- $this->setJsonHeaders();
+ public function getSchedules($page = 0, $per_page = 30){
$url = "projects/{$this->project_id}/schedules";
- $schedules = self::json_decode($this->apiCall(self::GET, $url));
+ $this->setJsonHeaders();
+ $params = array(
+ 'page' => $page,
+ 'per_page' => $per_page
+ );
+ $schedules = self::json_decode($this->apiCall(self::GET, $url, $params));
return $schedules->schedules;
}
View
BIN  iron_worker.phar
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.