chobie\Jira\Api::getVersions PHP Method

getVersions() public method

Get versions of a project.
public getVersions ( string $project_key ) : array | false
$project_key string Project key.
return array | false
    public function getVersions($project_key)
    {
        return $this->api(self::REQUEST_GET, sprintf('/rest/api/2/project/%s/versions', $project_key), array(), true);
    }

Usage Example

Example #1
0
 /**
  * Get versions of a project.
  *
  * @param string  $project_key    Project key.
  * @param integer $cache_duration Cache duration.
  *
  * @return array|false
  */
 public function getVersions($project_key, $cache_duration = 0)
 {
     $cache_key = __METHOD__ . '(' . $project_key . ')';
     $cached_value = $this->cache->fetch($cache_key);
     if ($cached_value === false) {
         $cached_value = parent::getVersions($project_key);
         $this->cache->save($cache_key, $cached_value, $cache_duration);
     }
     return $cached_value;
 }