EncodedValues
in package
implements
ValuesInterface
uses
DataConverterAwareTrait
List of typed values.
Tags
Table of Contents
Interfaces
Properties
- $payloads : TPayloadsCollection|null
- $values : array<string|int, mixed>|null
- $converter : DataConverterInterface|null
- $effectiveConverter : DataConverterInterface|null
- $serializationContext : SerializationContext|null
Methods
- count() : int<0, max>
- decodePromise() : PromiseInterface
- Decode promise response upon returning it to the domain layer.
- empty() : static
- fromPayloadCollection() : static
- fromPayloads() : EncodedValues
- fromValues() : static
- getDataConverter() : DataConverterInterface|null
- getSerializationContext() : SerializationContext|null
- getValue() : mixed
- Get value by it's index.
- getValues() : array<string|int, mixed>
- isEmpty() : bool
- Checks if any value present.
- setDataConverter() : void
- setSerializationContext() : void
- sliceValues() : ValuesInterface
- toPayloads() : Payloads
- Returns associated payloads.
- withSerializationContext() : static
- __construct() : mixed
- Can not be constructed directly.
- converter() : DataConverterInterface
- isVoidType() : bool
- toProtoCollection() : array<string|int, mixed>
- Returns collection of {@see Payloads}.
Properties
$payloads
protected
TPayloadsCollection|null
$payloads
= null
$values
protected
array<string|int, mixed>|null
$values
= null
$converter
private
DataConverterInterface|null
$converter
= null
$effectiveConverter
private
DataConverterInterface|null
$effectiveConverter
= null
$serializationContext
private
SerializationContext|null
$serializationContext
= null
Methods
count()
public
count() : int<0, max>
Return values
int<0, max>decodePromise()
Decode promise response upon returning it to the domain layer.
public
static decodePromise(PromiseInterface $promise[, null|mixed $type = null ]) : PromiseInterface
Parameters
- $promise : PromiseInterface
- $type : null|mixed = null
Tags
Return values
PromiseInterfaceempty()
public
static empty() : static
Return values
staticfromPayloadCollection()
public
static fromPayloadCollection(TPayloadsCollection $payloads[, DataConverterInterface|null $dataConverter = null ]) : static
Parameters
- $payloads : TPayloadsCollection
- $dataConverter : DataConverterInterface|null = null
Return values
staticfromPayloads()
public
static fromPayloads(Payloads $payloads, DataConverterInterface $dataConverter) : EncodedValues
Parameters
- $payloads : Payloads
- $dataConverter : DataConverterInterface
Return values
EncodedValuesfromValues()
public
static fromValues(array<string|int, mixed> $values[, DataConverterInterface|null $dataConverter = null ]) : static
Parameters
- $values : array<string|int, mixed>
- $dataConverter : DataConverterInterface|null = null
Return values
staticgetDataConverter()
public
getDataConverter() : DataConverterInterface|null
Return values
DataConverterInterface|nullgetSerializationContext()
public
getSerializationContext() : SerializationContext|null
Return values
SerializationContext|nullgetValue()
Get value by it's index.
public
getValue(int|string $index[, mixed $type = null ]) : mixed
Returns null if there are no values and $type has null value like null, Type::TYPE_VOID or Type::TYPE_NULL.
Parameters
- $index : int|string
- $type : mixed = null
getValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>isEmpty()
Checks if any value present.
public
isEmpty() : bool
Return values
boolsetDataConverter()
public
setDataConverter(DataConverterInterface $converter) : void
Parameters
- $converter : DataConverterInterface
setSerializationContext()
public
setSerializationContext(SerializationContext|null $context) : void
Parameters
- $context : SerializationContext|null
sliceValues()
public
static sliceValues(DataConverterInterface $converter, ValuesInterface $values, int $offset[, int|null $length = null ]) : ValuesInterface
Parameters
- $converter : DataConverterInterface
- $values : ValuesInterface
- $offset : int
- $length : int|null = null
Return values
ValuesInterfacetoPayloads()
Returns associated payloads.
public
toPayloads() : Payloads
Return values
PayloadswithSerializationContext()
public
withSerializationContext(SerializationContext|null $context) : static
Parameters
- $context : SerializationContext|null
Return values
static__construct()
Can not be constructed directly.
private
__construct() : mixed
converter()
private
converter() : DataConverterInterface
Return values
DataConverterInterfaceisVoidType()
private
isVoidType([mixed $type = null ]) : bool
Parameters
- $type : mixed = null
Return values
booltoProtoCollection()
Returns collection of {@see Payloads}.
private
toProtoCollection() : array<string|int, mixed>