Documentation

ObjectField extends BaseField
in package

A field containing a nested set of inference fields.

Table of Contents

Properties

$confidence  : FieldConfidence|null
$fields  : InferenceFields
$locations  : array<string|int, FieldLocation>
$indentLevel  : int

Methods

__construct()  : mixed
__toString()  : string
Base str-rep. Do not use.
createField()  : ListField|ObjectField|SimpleField
getListField()  : ListField
Returns a ListField instance for the specified key.
getListFields()  : array<string|int, ListField>
Returns an array of ListField instances.
getObjectField()  : self
Returns an ObjectField instance for the specified key.
getObjectFields()  : array<string|int, ObjectField>
Returns an array of ObjectField instances.
getSimpleField()  : SimpleField
Returns a SimpleField instance for the specified key.
getSimpleFields()  : array<string|int, SimpleField>
Returns an array of SimpleField instances.
toStringFromList()  : string
Returns a string representation suitable for list display.

Properties

Methods

__construct()

public __construct(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawResponse[, int $indentLevel = 0 ]) : mixed
Parameters
$rawResponse : array<string, int|float|string|bool|null|array<string|int, mixed>>

Raw server response array.

$indentLevel : int = 0

Level of indentation for rst display.

__toString()

Base str-rep. Do not use.

public __toString() : string
Return values
string

createField()

public static createField(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawPrediction[, int $indentLevel = 0 ]) : ListField|ObjectField|SimpleField
Parameters
$rawPrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>

Raw prediction array.

$indentLevel : int = 0

Level of indentation for rst display.

Tags
throws
MindeeApiException

Throws if the field type isn't recognized.

Return values
ListField|ObjectField|SimpleField

getListField()

Returns a ListField instance for the specified key.

public getListField(string $key) : ListField
Parameters
$key : string

The key of the list field to retrieve.

Tags
throws
InvalidArgumentException

When the field does not exist or is not a list field.

Return values
ListField

getListFields()

Returns an array of ListField instances.

public getListFields() : array<string|int, ListField>
Tags
throws
InvalidArgumentException

When a field does not exist or is not a list field.

Return values
array<string|int, ListField>

getObjectField()

Returns an ObjectField instance for the specified key.

public getObjectField(string $key) : self
Parameters
$key : string

The key of the simple field to retrieve.

Tags
throws
InvalidArgumentException

When the field does not exist or is not a simple field.

Return values
self

getObjectFields()

Returns an array of ObjectField instances.

public getObjectFields() : array<string|int, ObjectField>
Tags
throws
InvalidArgumentException

When a field does not exist or is not an object field.

Return values
array<string|int, ObjectField>

getSimpleField()

Returns a SimpleField instance for the specified key.

public getSimpleField(string $key) : SimpleField
Parameters
$key : string

The key of the simple field to retrieve.

Tags
throws
InvalidArgumentException

When the field does not exist or is not a simple field.

Return values
SimpleField

getSimpleFields()

Returns an array of SimpleField instances.

public getSimpleFields() : array<string|int, SimpleField>
Tags
throws
InvalidArgumentException

When a field does not exist or is not a simple field.

Return values
array<string|int, SimpleField>

toStringFromList()

Returns a string representation suitable for list display.

public toStringFromList() : string
Return values
string
On this page

Search results