AdvertisementAutoPlacement
in package
implements
JsonSerializable
Advertisement auto-placement configuration.
Controls how advertisements are automatically placed within the article.
Tags
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
$bannerType
Whether banner ads are enabled.
private
bool|null
$bannerType
= null
$distanceFromMedia
Distance from article start before first ad (in points or % of content).
private
int|null
$distanceFromMedia
= null
$enabled
Whether ads are enabled.
private
bool|null
$enabled
= null
$frequency
Frequency of ads (number of components between ads).
private
int|null
$frequency
= null
$layout
Layout for the advertisement component.
private
string|null
$layout
= null
Methods
disabled()
Create a disabled advertisement placement.
public
static disabled() : self
Return values
self —A new instance with ads disabled.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setBannerType()
Set whether banner type ads are enabled.
public
setBannerType(bool $enabled) : $this
Parameters
- $enabled : bool
-
Whether banners are enabled.
Return values
$thissetDistanceFromMedia()
Set the distance from media before placing an ad.
public
setDistanceFromMedia(int $distance) : $this
Parameters
- $distance : int
-
Distance in points.
Return values
$thissetEnabled()
Set whether ads are enabled.
public
setEnabled(bool $enabled) : $this
Parameters
- $enabled : bool
-
Whether ads are enabled.
Return values
$thissetFrequency()
Set the frequency of ads.
public
setFrequency(int $frequency) : $this
Parameters
- $frequency : int
-
Number of components between ads.
Return values
$thissetLayout()
Set the layout reference for ads.
public
setLayout(string $layout) : $this
Parameters
- $layout : string
-
Layout name.
Return values
$thiswithFrequency()
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.