CoolCMS API

InvalidFieldValueException extends HydrationException
in package

Thrown when a text value of a field cannot be converted to the type the field declares.

The external Api client sends data in the query string, so every value arrives as a string. The hydrator converts it by the setter type ('12' to 12, 'true' to true). When the conversion fails ('1.9' into int, a non-boolean word into bool), this exception carries the field name; without it the typed setter would fail with an unreadable TypeError.

Table of Contents

Properties

$expectedType  : string
$field  : string

Methods

__construct()  : mixed
getExpectedType()  : string
getField()  : string

Properties

Methods

__construct()

public __construct(string $field, string $expectedType, string $value) : mixed
Parameters
$field : string
$expectedType : string
$value : string
On this page

Search results