Apple News API PHP Client

ConditionalAutoPlacement
in package
implements ConditionalInterface

FinalYes

Conditional auto-placement configuration.

Allows ad placement settings to change based on conditions, such as disabling ads on small screens.

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

Table of Contents

Interfaces

ConditionalInterface
Interface for all conditional objects.

Properties

$advertisement  : AdvertisementAutoPlacement|null
The advertisement configuration.
$conditions  : array<int, Condition>
The conditions that must be met.
$enabled  : bool|null
Whether auto-placement is enabled.

Methods

addCondition()  : $this
Add a condition.
disableOnCompact()  : self
Create a conditional that disables ads on compact screens.
hasConditions()  : bool
Check if any conditions have been set.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setAdvertisement()  : $this
Set the advertisement configuration.
setEnabled()  : $this
Set whether auto-placement is enabled.

Properties

Methods

disableOnCompact()

Create a conditional that disables ads on compact screens.

public static disableOnCompact() : self
Return values
self —

A new instance.

hasConditions()

Check if any conditions have been set.

public hasConditions() : bool
Return values
bool —

True if conditions exist.

jsonSerialize()

{@inheritdoc}

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

setEnabled()

Set whether auto-placement is enabled.

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

Whether enabled.

Return values
$this

        
On this page

Search results