final class Timestamp implements TimestampInterface, Type, Serializable, JsonSerializable (View source)

Represents a BSON timestamp, which is an internal MongoDB type not intended for general date storage.

Methods

__construct(int $increment, int $timestamp)

Construct a new Timestamp

string
__toString()

Returns the string representation of this Timestamp

static 
__set_state(array $properties)

No description

int
getIncrement()

Returns the increment component of this TimestampInterface

int
getTimestamp()

Returns the timestamp component of this TimestampInterface

string|null
serialize()

Serialize a Timestamp

void
unserialize(string $data)

Unserialize a Timestamp

mixed
jsonSerialize()

Returns a representation that can be converted to JSON

Details

final __construct(int $increment, int $timestamp)

Construct a new Timestamp

Parameters

int $increment
int $timestamp

final string __toString()

Returns the string representation of this Timestamp

Return Value

string

static __set_state(array $properties)

No description

Parameters

array $properties

final int getIncrement()

Since: 1.3.0

Returns the increment component of this TimestampInterface

Return Value

int

final int getTimestamp()

Since: 1.3.0

Returns the timestamp component of this TimestampInterface

Return Value

int

final string|null serialize()

Since: 1.2.0

Serialize a Timestamp

Return Value

string|null

The string representation of the object or null

Exceptions

InvalidArgumentException

final void unserialize(string $data)

Since: 1.2.0

Unserialize a Timestamp

Parameters

string $data

The string representation of the object.

Return Value

void

Exceptions

InvalidArgumentException
UnexpectedValueException

final mixed jsonSerialize()

Since: 1.2.0

Returns a representation that can be converted to JSON

Return Value

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

Exceptions

InvalidArgumentException