Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JGithubMilestones
+ Graphe d'héritage de JGithubMilestones:
+ Graphe de collaboration de JGithubMilestones:

Liste de tous les membres

Fonctions membres publiques

 getList ($user, $repo, $state= 'open', $sort= 'due_date', $direction= 'desc', $page=0, $limit=0)
 get ($user, $repo, $milestoneId)
 create ($user, $repo, $title, $state=null, $description=null, $due_on=null)
 edit ($user, $repo, $milestoneId, $title=null, $state=null, $description=null, $due_on=null)
 delete ($user, $repo, $milestoneId)
- Fonctions membres publiques inherited from JGithubObject
 __construct (JRegistry $options=null, JGithubHttp $client=null)

Additional Inherited Members

- Fonctions membres protégées inherited from JGithubObject
 fetchUrl ($path, $page=0, $limit=0)
 processResponse (JHttpResponse $response, $expectedCode=200)
- Attributs protégés inherited from JGithubObject
 $options
 $client

Description détaillée

Définition à la ligne 19 du fichier milestones.php.


Documentation des fonctions membres

JGithubMilestones::create (   $user,
  $repo,
  $title,
  $state = null,
  $description = null,
  $due_on = null 
)

Method to create a milestone for a repository.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$titleThe title of the milestone.
string$stateCan be open (default) or closed.
string$descriptionOptional description for milestone.
string$due_onOptional ISO 8601 time.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 103 du fichier milestones.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones';
// Build the request data.
$data = array(
'title' => $title
);
if (!is_null($state))
{
$data['state'] = $state;
}
if (!is_null($description))
{
$data['description'] = $description;
}
if (!is_null($due_on))
{
$data['due_on'] = $due_on;
}
$data = json_encode($data);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubMilestones::delete (   $user,
  $repo,
  $milestoneId 
)

Method to delete a milestone.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$milestoneIdThe id of the milestone to delete.
Renvoie:
void
Depuis:
12.3

Définition à la ligne 214 du fichier milestones.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId;
// Send the request.
$response = $this->client->delete($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 204)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
}
JGithubMilestones::edit (   $user,
  $repo,
  $milestoneId,
  $title = null,
  $state = null,
  $description = null,
  $due_on = null 
)

Method to update a milestone.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$milestoneIdThe id of the comment to update.
integer$titleOptional title of the milestone.
string$stateCan be open (default) or closed.
string$descriptionOptional description for milestone.
string$due_onOptional ISO 8601 time.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 159 du fichier milestones.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId;
// Build the request data.
$data = array();
if (!is_null($title))
{
$data['title'] = $title;
}
if (!is_null($state))
{
$data['state'] = $state;
}
if (!is_null($description))
{
$data['description'] = $description;
}
if (!is_null($due_on))
{
$data['due_on'] = $due_on;
}
$data = json_encode($data);
// Send the request.
$response = $this->client->patch($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubMilestones::get (   $user,
  $repo,
  $milestoneId 
)

Method to get a specific milestone.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$milestoneIdThe milestone id to get.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 70 du fichier milestones.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId;
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubMilestones::getList (   $user,
  $repo,
  $state = 'open',
  $sort = 'due_date',
  $direction = 'desc',
  $page = 0,
  $limit = 0 
)

Method to get the list of milestones for a repo.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$stateThe milestone state to retrieved. Open (default) or closed.
string$sortSort can be due_date (default) or completeness.
string$directionDirection is asc or desc (default).
integer$pageThe page number from which to get items.
integer$limitThe number of items on a page.
Renvoie:
array
Depuis:
12.3

Définition à la ligne 36 du fichier milestones.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones?';
$path .= 'state=' . $state;
$path .= '&sort=' . $sort;
$path .= '&direction=' . $direction;
// Send the request.
$response = $this->client->get($this->fetchUrl($path, $page, $limit));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}

La documentation de cette classe a été générée à partir du fichier suivant :