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
Table of Contents
Properties
Methods
- __construct() : mixed
- Create a new ArticleLinks instance.
- fromArray() : self
- Create an ArticleLinks instance from API response data.
Properties
$channel read-only
public
string|null
$channel
= null
$sections read-only
public
array<int, string>
$sections
= []
$self read-only
public
string|null
$self
= null
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.