Apple News API PHP Client

ConditionalTableCellStyle
in package
implements ConditionalInterface

FinalYes

Conditional properties for table cell styles.

Allows table cell appearance to change based on conditions.

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

Table of Contents

Interfaces

ConditionalInterface
Interface for all conditional objects.

Properties

$backgroundColor  : string|null
The background color.
$conditions  : array<int, Condition>
The conditions that must be met.
$horizontalAlignment  : string|null
The horizontal alignment.
$minimumWidth  : int|null
The minimum width.
$padding  : int|array<string, mixed>|null
The padding.
$textColor  : string|null
The text color.
$verticalAlignment  : string|null
The vertical alignment.
$width  : int|null
The cell width.

Methods

addCondition()  : $this
Add a condition.
darkMode()  : self
Create a dark mode cell style.
hasConditions()  : bool
Check if any conditions have been set.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setBackgroundColor()  : $this
Set the background color.
setHorizontalAlignment()  : $this
Set the horizontal alignment.
setMinimumWidth()  : $this
Set the minimum width.
setPadding()  : $this
Set the padding.
setTextColor()  : $this
Set the text color.
setVerticalAlignment()  : $this
Set the vertical alignment.
setWidth()  : $this
Set the cell width.

Properties

Methods

darkMode()

Create a dark mode cell style.

public static darkMode(string $backgroundColor[, string|null $textColor = null ]) : self
Parameters
$backgroundColor : string

The dark mode background.

$textColor : string|null = null

Optional dark mode text color.

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>

setBackgroundColor()

Set the background color.

public setBackgroundColor(string $color) : $this
Parameters
$color : string

The color in hex format.

Return values
$this

setHorizontalAlignment()

Set the horizontal alignment.

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

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

Return values
$this

setMinimumWidth()

Set the minimum width.

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

The minimum width in points.

Return values
$this

setPadding()

Set the padding.

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

The padding.

Return values
$this

setTextColor()

Set the text color.

public setTextColor(string $color) : $this
Parameters
$color : string

The color in hex format.

Return values
$this

setVerticalAlignment()

Set the vertical alignment.

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

One of 'top', 'center', 'bottom'.

Return values
$this

setWidth()

Set the cell width.

public setWidth(int $width) : $this
Parameters
$width : int

The width in points.

Return values
$this

        
On this page

Search results