Documentation

ArrayCopyable

Interface to declare instances can be converted into/from arrays.

Classes which implement this interface can use the JsonTrait trait.

Table of Contents

copyFromArray()  : mixed
Copy the content of the given array into this object.
copyToArray()  : mixed
Copy the content of this object into the given array.

Methods

copyFromArray()

Copy the content of the given array into this object.

public copyFromArray(array<string|int, mixed> &$array) : mixed

As necessary, types of elements in the given array are converted into other types which are suitable for properties of this object.

Parameters
$array : array<string|int, mixed>

A reference of an array whose elements are used to set up properties of this object.

Return values
mixed

copyToArray()

Copy the content of this object into the given array.

public copyToArray(array<string|int, mixed> &$array) : mixed

As necessary, types of properties in this object are converted into other types which are friendly to json_encode().

Parameters
$array : array<string|int, mixed>

A reference of an array into which properties of this object are copied.

Return values
mixed

Search results