\Jkphl\Micrometa\Parser\Microformats2Item

Extended microformats2 item

Summary

Methods
Properties
Constants
__call()
__get()
__construct()
isOfType()
firstOf()
toObject()
toJSON()
__toString()
$types
$id
$value
$urlProperties
No constants found
_isItem()
_resolveUrlValue()
$_url
$_properties
N/A
No private methods found
No private properties found
N/A

Properties

$types

$types : \array

Item type list

Type

\array

$id

$id : \string

Explicit item ID

Type

\string

$value

$value : \string

Explicit item value

Type

\string

$urlProperties

$urlProperties : array

Properties holding URL strings (and that need to get expanded / sanitized)

Type

array

$_url

$_url : \Jkphl\Utility\Url

Item base URL (used for relative URL resolution)

Type

\Jkphl\Utility\Url

$_properties

$_properties : \array

List of nested properties

Type

\array

Methods

__call()

__call(\string $method, \array $arguments) : \array|\Jkphl\Micrometa\Parser\Microformats2\Item

Generic caller

Returns all nested microformats2 items of a spefic type (or a particular index out of this list)

Parameters

\string $method

Method name (lowerCamelCased microformats2 item type)

\array $arguments

List of arguments, of which the first is interpreted as list index (NULL = return the complete list)

Throws

\Jkphl\Micrometa\Parser\Microformats2\Exception

If it's not a valid microformats2 vocable

\Jkphl\Micrometa\Parser\Microformats2\Exception

If the item index is out of range

Returns

\array|\Jkphl\Micrometa\Parser\Microformats2\Item

List of microformats2 items or a single microformats2 item

__get()

__get(\string $key) : \mixed

Return a list of properties or a single property

Parameters

\string $key

Property (list) name

Returns

\mixed —

Property (list) value(s)

__construct()

__construct(\array $data, \Jkphl\Utility\Url $url) : \Jkphl\Micrometa\Item

Constructor

Parameters

\array $data

Item data

\Jkphl\Utility\Url $url

Item base URL

Returns

\Jkphl\Micrometa\Item

Micro information item

isOfType()

isOfType() : \boolean

Check if this item is of a specific type

Returns

\boolean —

If this item is of a specific type

firstOf()

firstOf() : \mixed

Return the first available property in a list of properties

Returns

\mixed —

Property value

toObject()

toObject() : \stdClass

Return a vanilla object representation of this item

Returns

\stdClass —

Vanilla object item representation

toJSON()

toJSON(\boolean $beautify) : \string

Return a JSON representation of the embedded micro information

Parameters

\boolean $beautify

Beautify the JSON output (available since PHP 5.4)

Returns

\string —

JSON representation

__toString()

__toString() : \string

String serialization as JSON object

Returns

\string —

String serialization as JSON object

_isItem()

_isItem(\mixed $item) : \boolean

Check if a subelement is a microcontent item itself

Parameters

\mixed $item

Subelement

Returns

\boolean —

Is an item

_resolveUrlValue()

_resolveUrlValue(\string $property, \mixed $value) : void

Sanitize URL values

Parameters

\string $property

Property name

\mixed $value

Value