\ChapterThree\AppleNewsAPI\Document\LayoutsLayout

An Apple News Document Layout.

Summary

Methods
Properties
Constants
jsonSerialize()
__toString()
json()
triggerError()
__construct()
getColumns()
setColumns()
getWidth()
setWidth()
getMargin()
setMargin()
getGutter()
setGutter()
No public properties found
No constants found
optional()
isSupportedUnit()
isUnitInterval()
isHexColor()
$columns
$width
$margin
$gutter
N/A
No private methods found
No private properties found
N/A

Properties

$columns

$columns : 

Type

$width

$width : 

Type

$margin

$margin : 

Type

$gutter

$gutter : 

Type

Methods

jsonSerialize()

jsonSerialize() 

Implements JsonSerializable::jsonSerialize().

__toString()

__toString() 

Implements __toString().

json()

json() : boolean|string

Generates json representation.

Returns

boolean|string —

JSON string, or FALSE on error.

triggerError()

triggerError(string  $message, integer  $message_type = E_USER_NOTICE) 

Error handler.

Parameters

string $message

Message.

integer $message_type

Matching E_USER_ERROR|E_USER_WARNING|E_USER_NOTICE|E_USER_DEPRECATED.

__construct()

__construct(integer  $columns, integer  $width) 

Implements __construct().

Parameters

integer $columns

Columns.

integer $width

Width.

getColumns()

getColumns() 

Getter for columns.

setColumns()

setColumns(integer  $value) : $this

Setter for columns.

Parameters

integer $value

Columns.

Returns

$this

getWidth()

getWidth() 

Getter for width.

setWidth()

setWidth(integer  $value) : $this

Setter for columns.

Parameters

integer $value

Width.

Returns

$this

getMargin()

getMargin() 

Getter for margin.

setMargin()

setMargin(integer  $value) : $this

Setter for margin.

Parameters

integer $value

Margin.

Returns

$this

getGutter()

getGutter() 

Getter for gutter.

setGutter()

setGutter(integer  $value) : $this

Setter for gutter.

Parameters

integer $value

Gutter.

Returns

$this

optional()

optional() 

Define optional properties.

isSupportedUnit()

isSupportedUnit(mixed  $value) : boolean

Helper function to determine if a value is suffixed by a supported unit.

Parameters

mixed $value

Value.

Returns

boolean —

Result.

isUnitInterval()

isUnitInterval(float|integer  $value) : boolean

Helper function to determine if a value is a unit interval.

A unit interval is the closed interval [0,1], that is, the set of all real numbers that are greater than or equal to 0 and less than or equal to 1.

Parameters

float|integer $value

Value.

Returns

boolean —

Result.

isHexColor()

isHexColor(string  $value) : boolean

Helper to validate color hex code.

Valid codes are hexadecimal numbers of length 3, 6 or 8 (with opacity), prefixed with "#".

Parameters

string $value

Value.

Returns

boolean —

Result.