API Documentation

SerializableContract extends JsonSerializable, Arrayable, Jsonable

Specifies that a class can be serialized to an array and/or JSON.

Tags
template

TKey of array-key

template

TValue

Table of Contents

Methods

jsonSerialize()  : array<string|int, mixed>
Specify data which should be serialized to JSON.
toArray()  : array<string|int, mixed>
Get the instance as an array.
toJson()  : string
Convert the instance to its JSON representation.

Methods

jsonSerialize()

Specify data which should be serialized to JSON.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

toArray()

Get the instance as an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toJson()

Convert the instance to its JSON representation.

public toJson([int $options = 0 ]) : string
Parameters
$options : int = 0
Return values
string

        
On this page

Search results