Apple News API PHP Client

ComponentLink
in package
implements AdditionInterface

FinalYes

Component link for making entire components tappable.

Unlike LinkAddition which targets text ranges, ComponentLink makes the entire component interactive.

Tags
see
https://developer.apple.com/documentation/apple_news/componentlink

Table of Contents

Interfaces

AdditionInterface
Interface for all addition types.

Properties

$url  : string

Methods

__construct()  : mixed
Create a new ComponentLink.
getType()  : string
Get the addition type identifier.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
to()  : self
Create a component link with a URL.

Properties

Methods

__construct()

Create a new ComponentLink.

public __construct(string $url) : mixed
Parameters
$url : string

The link URL.

getType()

Get the addition type identifier.

public getType() : string
Return values
string —

The addition type.

jsonSerialize()

{@inheritdoc}

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

to()

Create a component link with a URL.

public static to(string $url) : self
Parameters
$url : string

The URL to link to.

Return values
self —

A new instance.


        
On this page

Search results