Apple News API PHP Client

AdvertisementAutoPlacement
in package
implements JsonSerializable

FinalYes

Advertisement auto-placement configuration.

Controls how advertisements are automatically placed within the article.

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

Table of Contents

Interfaces

JsonSerializable

Properties

$bannerType  : bool|null
Whether banner ads are enabled.
$distanceFromMedia  : int|null
Distance from article start before first ad (in points or % of content).
$enabled  : bool|null
Whether ads are enabled.
$frequency  : int|null
Frequency of ads (number of components between ads).
$layout  : string|null
Layout for the advertisement component.

Methods

disabled()  : self
Create a disabled advertisement placement.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setBannerType()  : $this
Set whether banner type ads are enabled.
setDistanceFromMedia()  : $this
Set the distance from media before placing an ad.
setEnabled()  : $this
Set whether ads are enabled.
setFrequency()  : $this
Set the frequency of ads.
setLayout()  : $this
Set the layout reference for ads.
withFrequency()  : self
Create an advertisement placement with specific frequency.

Properties

$distanceFromMedia

Distance from article start before first ad (in points or % of content).

private int|null $distanceFromMedia = null

Methods

disabled()

Create a disabled advertisement placement.

public static disabled() : self
Return values
self —

A new instance with ads disabled.

setBannerType()

Set whether banner type ads are enabled.

public setBannerType(bool $enabled) : $this
Parameters
$enabled : bool

Whether banners are enabled.

Return values
$this

setDistanceFromMedia()

Set the distance from media before placing an ad.

public setDistanceFromMedia(int $distance) : $this
Parameters
$distance : int

Distance in points.

Return values
$this

setEnabled()

Set whether ads are enabled.

public setEnabled(bool $enabled) : $this
Parameters
$enabled : bool

Whether ads are enabled.

Return values
$this

setFrequency()

Set the frequency of ads.

public setFrequency(int $frequency) : $this
Parameters
$frequency : int

Number of components between ads.

Return values
$this

setLayout()

Set the layout reference for ads.

public setLayout(string $layout) : $this
Parameters
$layout : string

Layout name.

Return values
$this

withFrequency()

Create an advertisement placement with specific frequency.

public static withFrequency(int $frequency) : self
Parameters
$frequency : int

Number of components between ads.

Return values
self —

A new instance.


        
On this page

Search results