final class Symbol implements Type, Serializable, JsonSerializable (View source)

BSON type for the "Symbol" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON symbol type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database.

Methods

string|null
serialize()

Serialize a Symbol

void
unserialize(string $data)

Unserialize a Symbol

mixed
jsonSerialize()

Returns a representation that can be converted to JSON

string
__toString()

Returns the Symbol as a string

Details

final string|null serialize()

Since: 1.2.0

Serialize a Symbol

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 Symbol

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

final string __toString()

Returns the Symbol as a string

Return Value

string

Returns the string representation of this Symbol.