Documentation

Parseable

The `Parseable` interface is used when defining custom parsing of a field.

To specify custom parsing, create a class that implements this interface and pass the class string to the Field constructor using the parser property.

As an example: #[Field(name: "Test", parser: TestParser::class)] protected TestClass $test;

Tags
template

T of mixed - The type to parse from.

template

U of mixed - The type to parse to.

Table of Contents

parse()  : U
serialize()  : T

Methods

parse()

public parse(T $value) : U
Parameters
$value : T
  • The data to parse
Return values
U

serialize()

public serialize(U $value) : T
Parameters
$value : U
Return values
T

Search results