final class Binary implements Type, BinaryInterface, Serializable, JsonSerializable (View source)

Class Binary

Constants

TYPE_GENERIC

TYPE_FUNCTION

TYPE_OLD_BINARY

TYPE_OLD_UUID

TYPE_UUID

TYPE_MD5

TYPE_ENCRYPTED Since: 1.7.0

TYPE_COLUMN Since: 1.12.0

TYPE_USER_DEFINED

Methods

__construct(string $data, int $type = Binary::TYPE_GENERIC)

Binary constructor.

string
getData()

Returns the Binary's data

int
getType()

Returns the Binary's type

static 
__set_state(array $properties)

No description

string
__toString()

Returns the Binary's data

string|null
serialize()

Serialize a Binary

void
unserialize(string $data)

Unserialize a Binary

mixed
jsonSerialize()

Returns a representation that can be converted to JSON

Details

final __construct(string $data, int $type = Binary::TYPE_GENERIC)

Binary constructor.

Parameters

string $data
int $type

final string getData()

Returns the Binary's data

Return Value

string

Returns the BinaryInterface's data

final int getType()

Returns the Binary's type

Return Value

int

Returns the BinaryInterface's type.

static __set_state(array $properties)

No description

Parameters

array $properties

final string __toString()

Returns the Binary's data

Return Value

string

Returns the BinaryInterface's data.

final string|null serialize()

Since: 1.2.0

Serialize a Binary

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 Binary

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