Apple News API PHP Client

ConditionalComponentLayout
in package
implements ConditionalInterface

FinalYes

Conditional properties for component layouts.

Allows layout properties like margin, padding, and column span to change based on conditions.

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

Table of Contents

Interfaces

ConditionalInterface
Interface for all conditional objects.

Properties

$columnSpan  : int|null
The column span.
$columnStart  : int|null
The column start position.
$conditions  : array<int, Condition>
The conditions that must be met.
$contentInset  : int|array<string, mixed>|null
The content inset.
$horizontalContentAlignment  : string|null
The horizontal content alignment.
$ignoreDocumentGutter  : bool|null
Whether to ignore document gutter.
$ignoreDocumentMargin  : bool|null
Whether to ignore document margin.
$margin  : int|array<string, mixed>|null
The margin configuration.
$maximumWidth  : int|string|null
The maximum width.
$minimumHeight  : int|string|null
The minimum height.
$minimumWidth  : int|string|null
The minimum width.
$padding  : int|array<string, mixed>|null
The padding.

Methods

addCondition()  : $this
Add a condition.
fullWidthOnCompact()  : self
Create a full-width layout for compact devices.
hasConditions()  : bool
Check if any conditions have been set.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setColumnSpan()  : $this
Set the column span.
setColumnStart()  : $this
Set the column start.
setContentInset()  : $this
Set the content inset.
setHorizontalContentAlignment()  : $this
Set the horizontal content alignment.
setIgnoreDocumentGutter()  : $this
Set whether to ignore document gutter.
setIgnoreDocumentMargin()  : $this
Set whether to ignore document margin.
setMargin()  : $this
Set the margin.
setMaximumWidth()  : $this
Set the maximum width.
setMinimumHeight()  : $this
Set the minimum height.
setMinimumWidth()  : $this
Set the minimum width.
setPadding()  : $this
Set the padding.

Properties

$horizontalContentAlignment

The horizontal content alignment.

private string|null $horizontalContentAlignment = null

Methods

fullWidthOnCompact()

Create a full-width layout for compact devices.

public static fullWidthOnCompact() : 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.

setColumnSpan()

Set the column span.

public setColumnSpan(int $columnSpan) : $this
Parameters
$columnSpan : int

Number of columns to span.

Return values
$this

setColumnStart()

Set the column start.

public setColumnStart(int $columnStart) : $this
Parameters
$columnStart : int

The starting column.

Return values
$this

setContentInset()

Set the content inset.

public setContentInset(int|array<string, mixed> $inset) : $this
Parameters
$inset : int|array<string, mixed>

The inset value or configuration.

Return values
$this

setHorizontalContentAlignment()

Set the horizontal content alignment.

public setHorizontalContentAlignment(string $alignment) : $this
Parameters
$alignment : string

One of 'left', 'center', 'right'.

Return values
$this

setIgnoreDocumentGutter()

Set whether to ignore document gutter.

public setIgnoreDocumentGutter(bool $ignore) : $this
Parameters
$ignore : bool

Whether to ignore.

Return values
$this

setIgnoreDocumentMargin()

Set whether to ignore document margin.

public setIgnoreDocumentMargin(bool $ignore) : $this
Parameters
$ignore : bool

Whether to ignore.

Return values
$this

setMargin()

Set the margin.

public setMargin(int|array<string, mixed> $margin) : $this
Parameters
$margin : int|array<string, mixed>

The margin value or configuration.

Return values
$this

setMaximumWidth()

Set the maximum width.

public setMaximumWidth(int|string $width) : $this
Parameters
$width : int|string

The maximum width.

Return values
$this

setMinimumHeight()

Set the minimum height.

public setMinimumHeight(int|string $height) : $this
Parameters
$height : int|string

The minimum height.

Return values
$this

setMinimumWidth()

Set the minimum width.

public setMinimumWidth(int|string $width) : $this
Parameters
$width : int|string

The minimum width.

Return values
$this

setPadding()

Set the padding.

public setPadding(int|array<string, mixed> $padding) : $this
Parameters
$padding : int|array<string, mixed>

The padding value or configuration.

Return values
$this

        
On this page

Search results