JiraRestApi\Project\ProjectService::getAllProjects PHP Method

getAllProjects() public method

get all project list.
public getAllProjects ( ) : array
return array of Project class
    public function getAllProjects()
    {
        $ret = $this->exec($this->uri, null);
        $prjs = $this->json_mapper->mapArray(json_decode($ret, false), new \ArrayObject(), '\\JiraRestApi\\Project\\Project');
        return $prjs;
    }

Usage Example

 public function testGetProjectLists()
 {
     //$this->markTestIncomplete();
     try {
         $proj = new ProjectService();
         $prjs = $proj->getAllProjects();
         foreach ($prjs as $p) {
             echo sprintf("Project Key:%s, Id:%s, Name:%s, projectCategory: %s\n", $p->key, $p->id, $p->name, $p->projectCategory['name']);
         }
     } catch (HTTPException $e) {
         $this->assertTrue(false, $e->getMessage());
     }
 }
All Usage Examples Of JiraRestApi\Project\ProjectService::getAllProjects