class JGithubPackageGists extends JGithubPackage

GitHub API Gists class for the Joomla Platform.

Methods

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

__get( string $name)

Magic method to lazily create API objects

object
create( mixed $files, boolean $public = false, string $description = null)

Method to create a gist.

void
delete( integer $gistId)

Method to delete a gist.

object
edit( integer $gistId, mixed $files = null, boolean $public = null, string $description = null)

Method to update a gist.

object
fork( integer $gistId)

Method to fork a gist.

object
get( integer $gistId)

Method to get a single gist.

array
getList( integer $page, integer $limit)

Method to list gists. If a user is authenticated it will return the user's gists, otherwise it will return all public gists.

array
getListByUser( string $user, integer $page, integer $limit)

Method to get a list of gists belonging to a given user.

array
getListPublic( integer $page, integer $limit)

Method to get a list of all public gists.

array
getListStarred( integer $page, integer $limit)

Method to get a list of the authenticated users' starred gists.

boolean
isStarred( integer $gistId)

Method to check if a gist has been starred.

void
star( integer $gistId)

Method to star a gist.

void
unstar( integer $gistId)

Method to star a gist.

object
createComment( integer $gistId, string $body)

Method to create a comment on a gist.

void
deleteComment( integer $commentId)

Method to delete a comment on a gist.

object
editComment( integer $commentId, string $body)

Method to update a comment on a gist.

object
getComment( integer $commentId)

Method to get a specific comment on a gist.

array
getComments( integer $gistId, integer $page, integer $limit)

Method to get the list of comments on a gist.

Details

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

Parameters

Registry $options GitHub options object.
JGithubHttp $client The HTTP client object.

JGithubPackage __get( string $name)

Magic method to lazily create API objects

Parameters

string $name Name of property to retrieve

Return Value

JGithubPackage GitHub API package object.

Exceptions

RuntimeException

object create( mixed $files, boolean $public = false, string $description = null)

Method to create a gist.

Parameters

mixed $files Either an array of file paths or a single file path as a string.
boolean $public True if the gist should be public.
string $description The optional description of the gist.

Return Value

object

Exceptions

DomainException

void delete( integer $gistId)

Method to delete a gist.

Parameters

integer $gistId The gist number.

Return Value

void

Exceptions

DomainException

object edit( integer $gistId, mixed $files = null, boolean $public = null, string $description = null)

Method to update a gist.

Parameters

integer $gistId The gist number.
mixed $files Either an array of file paths or a single file path as a string.
boolean $public True if the gist should be public.
string $description The description of the gist.

Return Value

object

Exceptions

DomainException

object fork( integer $gistId)

Method to fork a gist.

Parameters

integer $gistId The gist number.

Return Value

object

Exceptions

DomainException

object get( integer $gistId)

Method to get a single gist.

Parameters

integer $gistId The gist number.

Return Value

object

Exceptions

DomainException

array getList( integer $page, integer $limit)

Method to list gists. If a user is authenticated it will return the user's gists, otherwise it will return all public gists.

Parameters

integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

array getListByUser( string $user, integer $page, integer $limit)

Method to get a list of gists belonging to a given user.

Parameters

string $user The name of the GitHub user from which to list gists.
integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

array getListPublic( integer $page, integer $limit)

Method to get a list of all public gists.

Parameters

integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

array getListStarred( integer $page, integer $limit)

Method to get a list of the authenticated users' starred gists.

Parameters

integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

boolean isStarred( integer $gistId)

Method to check if a gist has been starred.

Parameters

integer $gistId The gist number.

Return Value

boolean True if the gist is starred.

Exceptions

DomainException

void star( integer $gistId)

Method to star a gist.

Parameters

integer $gistId The gist number.

Return Value

void

Exceptions

DomainException

void unstar( integer $gistId)

Method to star a gist.

Parameters

integer $gistId The gist number.

Return Value

void

Exceptions

DomainException

object createComment( integer $gistId, string $body)

Method to create a comment on a gist.

Parameters

integer $gistId The gist number.
string $body The comment body text.

Return Value

object

void deleteComment( integer $commentId)

Method to delete a comment on a gist.

Parameters

integer $commentId The id of the comment to delete.

Return Value

void

object editComment( integer $commentId, string $body)

Method to update a comment on a gist.

Parameters

integer $commentId The id of the comment to update.
string $body The new body text for the comment.

Return Value

object

object getComment( integer $commentId)

Method to get a specific comment on a gist.

Parameters

integer $commentId The comment id to get.

Return Value

object

array getComments( integer $gistId, integer $page, integer $limit)

Method to get the list of comments on a gist.

Parameters

integer $gistId The gist number.
integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array