Apple News API PHP Client

ArticleLinks
in package

FinalYes

Links associated with an article response.

Contains URLs for related API resources such as the channel, the article itself, and any sections the article belongs to.

Tags
see
https://developer.apple.com/documentation/applenewsapi/articlelinksresponse

Table of Contents

Properties

$channel  : string|null
$sections  : array<int, string>
$self  : string|null

Methods

__construct()  : mixed
Create a new ArticleLinks instance.
fromArray()  : self
Create an ArticleLinks instance from API response data.

Properties

$sections read-only

public array<int, string> $sections = []

Methods

__construct()

Create a new ArticleLinks instance.

public __construct([string|null $channel = null ][, string|null $self = null ][, array<int, string> $sections = [] ]) : mixed
Parameters
$channel : string|null = null

URL to the channel resource containing this article.

$self : string|null = null

URL to this article resource.

$sections : array<int, string> = []

URLs to section resources this article belongs to.

fromArray()

Create an ArticleLinks instance from API response data.

public static fromArray(array<string, mixed> $data) : self
Parameters
$data : array<string, mixed>

The links data from the API response.

Return values
self

A new ArticleLinks instance populated with the response data.


        
On this page

Search results