PHP Class Apple_Push_API\API

Since: 0.2.0
Datei anzeigen Open project: alleyinteractive/apple-news

Public Methods

Method Description
__construct ( $endpoint, $credentials, $debug = false ) Constructor.
delete_article ( integer $article_id ) : object Deletes an article using a DELETE request.
get_article ( integer $article_id ) : object Gets article information.
get_channel ( string $channel_uuid ) : object Gets channel information.
get_section ( string $section_id ) : object Gets information for a section.
get_sections ( string $channel_uuid ) : object Gets all sections in the given channel.
post_article_to_channel ( string $article, string $channel_uuid, array $bundles = [], array $meta = [] ) : object Sends a new article to a given channel.
update_article ( string $uid, $revision, string $article, array $bundles = [], $meta = [] ) : object Updates an existing article to a given channel.

Private Methods

Method Description
send_delete_request ( string $url ) : object Send a delete request.
send_get_request ( string $url ) : object Send a get request.
send_post_request ( string $url, string $article, array $bundles, array $meta = null ) : object Send a post request.

Method Details

__construct() public method

Constructor.
public __construct ( $endpoint, $credentials, $debug = false )

delete_article() public method

Deletes an article using a DELETE request.
Since: 0.4.0
public delete_article ( integer $article_id ) : object
$article_id integer
return object

get_article() public method

Gets article information.
Since: 0.2.0
public get_article ( integer $article_id ) : object
$article_id integer
return object

get_channel() public method

Gets channel information.
Since: 0.2.0
public get_channel ( string $channel_uuid ) : object
$channel_uuid string
return object

get_section() public method

Gets information for a section.
Since: 0.2.0
public get_section ( string $section_id ) : object
$section_id string
return object

get_sections() public method

Gets all sections in the given channel.
Since: 0.2.0
public get_sections ( string $channel_uuid ) : object
$channel_uuid string
return object

post_article_to_channel() public method

Sends a new article to a given channel.
Since: 0.2.0
public post_article_to_channel ( string $article, string $channel_uuid, array $bundles = [], array $meta = [] ) : object
$article string The JSON string representing the article
$channel_uuid string
$bundles array An array of file paths for the article attachments
$meta array
return object

update_article() public method

Updates an existing article to a given channel.
Since: 0.2.0
public update_article ( string $uid, $revision, string $article, array $bundles = [], $meta = [] ) : object
$uid string
$article string The JSON string representing the article
$bundles array An array of file paths for the article attachments
return object