FileAccess Orion

Serialization

Trait Serialization.

Serialization and JSON stuff.

Depends on the following properties:

Table of Contents

$daysInMonth  : int
$month  : int
$quarter  : int
$year  : int
$dumpLocale  : string|null
Locale to dump comes here before serialization.
$dumpProperties  : array<string|int, string>
List of key to use for dump/serialization.
$serializer  : callable|null
The custom Carbon JSON serializer.
__set_state()  : static
The __set_state handler.
__sleep()  : array<string|int, mixed>
Returns the list of properties to dump on serialize() called on.
__wakeup()  : mixed
Set locale if specified on unserialize() called.
cleanupDumpProperties()  : mixed
Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.
fromSerialized()  : static
Create an instance from a serialized string.
jsonSerialize()  : array<string|int, mixed>|string
Prepare the object for JSON serialization.
locale()  : string|static
serialize()  : string
Return a serialized string of the instance.
serializeUsing()  : void
toJSON()  : string

Properties

$quarter

public int $quarter

Depends on the following methods:

$dumpLocale

Locale to dump comes here before serialization.

protected string|null $dumpLocale = null

$dumpProperties

List of key to use for dump/serialization.

protected array<string|int, string> $dumpProperties = ['date', 'timezone_type', 'timezone']

$serializer

The custom Carbon JSON serializer.

protected static callable|null $serializer

Methods

__set_state()

The __set_state handler.

public static __set_state(string|array<string|int, mixed> $dump) : static
Parameters
$dump : string|array<string|int, mixed>
Return values
static —

__sleep()

Returns the list of properties to dump on serialize() called on.

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

__wakeup()

Set locale if specified on unserialize() called.

public __wakeup() : mixed
Return values
mixed —

cleanupDumpProperties()

Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.

public cleanupDumpProperties() : mixed

foreach ($date as $_) } serializer($date) var_export($date) get_object_vars($date)

Return values
mixed —

fromSerialized()

Create an instance from a serialized string.

public static fromSerialized(string $value) : static
Parameters
$value : string
Tags
throws
InvalidFormatException
Return values
static —

jsonSerialize()

Prepare the object for JSON serialization.

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

locale()

public locale(string $locale = null) : string|static
Parameters
$locale = null : string
Return values
string|static —

serialize()

Return a serialized string of the instance.

public serialize() : string
Return values
string —

serializeUsing()

public static serializeUsing(callable $callback) : void
Parameters
$callback : callable
Tags
deprecated

To avoid conflict between different third-party libraries, static setters should not be used. You should rather transform Carbon object before the serialization.

JSON serialize all Carbon instances using the given callback.

Return values
void —

Search results