RData
in package
implements
IteratorAggregate, Countable
Represents a data type comprising multiple simple types
Tags
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
$typeDef
private
TypeDefinition
$typeDef
Structural definition of the fields
Methods
__construct()
Constructor
public
__construct(TypeDefinition $typeDef) : mixed
Parameters
- $typeDef : TypeDefinition
__toString()
Magic method for type coersion to string
public
__toString() : string
Return values
stringcount()
Get the number of fields (Countable interface)
public
count() : int
Return values
intgetField()
Get the field indicated by the supplied index
public
getField(int $index) : Type
Parameters
- $index : int
Tags
Return values
TypegetFieldByName()
Get the field indicated by the supplied name
public
getFieldByName(string $name) : Type
Parameters
- $name : string
Tags
Return values
TypegetIterator()
Retrieve an iterator (IteratorAggregate interface)
public
getIterator() : Iterator
Return values
IteratorgetTypeDefinition()
Get the structural definition of the fields
public
getTypeDefinition() : TypeDefinition
Return values
TypeDefinitionsetField()
Set the field indicated by the supplied index
public
setField(int $index, Type $value) : mixed
Parameters
- $index : int
- $value : Type
Tags
setFieldByName()
Set the field indicated by the supplied name
public
setFieldByName(string $name, Type $value) : mixed
Parameters
- $name : string
- $value : Type