Documentation

RData
in package
implements IteratorAggregate, Countable

Represents a data type comprising multiple simple types

Tags
category

LibDNS

author

Chris Wright https://github.com/DaveRandom

Table of Contents

Interfaces

IteratorAggregate
Countable

Properties

$fields  : array<string|int, Type>
$typeDef  : TypeDefinition

Methods

__construct()  : mixed
Constructor
__toString()  : string
Magic method for type coersion to string
count()  : int
Get the number of fields (Countable interface)
getField()  : Type
Get the field indicated by the supplied index
getFieldByName()  : Type
Get the field indicated by the supplied name
getIterator()  : Iterator
Retrieve an iterator (IteratorAggregate interface)
getTypeDefinition()  : TypeDefinition
Get the structural definition of the fields
setField()  : mixed
Set the field indicated by the supplied index
setFieldByName()  : mixed
Set the field indicated by the supplied name

Properties

$fields

private array<string|int, Type> $fields = []

The items that make up the complex type

Methods

__toString()

Magic method for type coersion to string

public __toString() : string
Return values
string

count()

Get the number of fields (Countable interface)

public count() : int
Return values
int

getField()

Get the field indicated by the supplied index

public getField(int $index) : Type
Parameters
$index : int
Tags
throws
OutOfBoundsException

When the supplied index does not refer to a valid field

Return values
Type

getFieldByName()

Get the field indicated by the supplied name

public getFieldByName(string $name) : Type
Parameters
$name : string
Tags
throws
OutOfBoundsException

When the supplied name does not refer to a valid field

Return values
Type

getIterator()

Retrieve an iterator (IteratorAggregate interface)

public getIterator() : Iterator
Return values
Iterator

setField()

Set the field indicated by the supplied index

public setField(int $index, Type $value) : mixed
Parameters
$index : int
$value : Type
Tags
throws
InvalidArgumentException

When the supplied index/value pair does not match the type definition

setFieldByName()

Set the field indicated by the supplied name

public setFieldByName(string $name, Type $value) : mixed
Parameters
$name : string
$value : Type
Tags
throws
OutOfBoundsException

When the supplied name does not refer to a valid field

throws
InvalidArgumentException

When the supplied value does not match the type definition


        
On this page

Search results