PHP Класс Mongolid\Serializer\Type\UTCDateTime

Наследование: implements Mongolid\Serializer\SerializableTypeInterface, implements JsonSerializabl\JsonSerializable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$mongoDate MongoDB\BSON\UTCDateTime
$timestamp integer

Открытые методы

Метод Описание
__call ( string $method, array $args = [] ) : mixed A wrapper to use this class as MongoUTCDateTime.
__construct ( integer | MongoDB\BSON\UTCDateTime | null $datetime = null ) Constructor.
__toString ( ) : string Allows casting to string utilizing drivers UTCDateTime implementation.
convert ( ) : MongoDB\BSON\UTCDateTime
jsonSerialize ( ) : string
serialize ( ) : string
toLocalDateTime ( ) : DateTime Retrieve a DateTime object with proper timezone set.
unserialize ( mixed $data ) : void

Защищенные методы

Метод Описание
init ( integer | MongoDB\BSON\UTCDateTime | null $datetime ) : boolean Initializes timestamp and mongoDate variables.

Описание методов

__call() публичный метод

A wrapper to use this class as MongoUTCDateTime.
public __call ( string $method, array $args = [] ) : mixed
$method string Method of MongoUTCDateTime to call.
$args array Arguments to pass.
Результат mixed

__construct() публичный метод

Constructor.
public __construct ( integer | MongoDB\BSON\UTCDateTime | null $datetime = null )
$datetime integer | MongoDB\BSON\UTCDateTime | null MongoUTCDateTime or Timestamp to wrap. If it was null, uses current timestamp.

__toString() публичный метод

Allows casting to string utilizing drivers UTCDateTime implementation.
public __toString ( ) : string
Результат string Returns the string representation of this UTCDateTime.

convert() публичный метод

public convert ( ) : MongoDB\BSON\UTCDateTime
Результат MongoDB\BSON\UTCDateTime

init() защищенный метод

Initializes timestamp and mongoDate variables.
protected init ( integer | MongoDB\BSON\UTCDateTime | null $datetime ) : boolean
$datetime integer | MongoDB\BSON\UTCDateTime | null MongoUTCDateTime or Timestamp to wrap. If it was null, uses current timestamp.
Результат boolean

jsonSerialize() публичный метод

public jsonSerialize ( ) : string
Результат string

serialize() публичный метод

public serialize ( ) : string
Результат string

toLocalDateTime() публичный метод

Retrieve a DateTime object with proper timezone set.
public toLocalDateTime ( ) : DateTime
Результат DateTime

unserialize() публичный метод

public unserialize ( mixed $data ) : void
$data mixed Serialized string to parse.
Результат void

Описание свойств

$mongoDate защищенное свойство

protected UTCDateTime,MongoDB\BSON $mongoDate
Результат MongoDB\BSON\UTCDateTime

$timestamp защищенное свойство

protected int $timestamp
Результат integer