final class Binary implements Type, BinaryInterface, JsonSerializable, Stringable (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_SENSITIVE Since: 1.17.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 Binary
__set_state(array $properties)

No description

string
__toString()

Returns the Binary's data

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 Binary __set_state(array $properties)

No description

Parameters

array $properties

Return Value

Binary

final string __toString()

Returns the Binary's data

Return Value

string

Returns the BinaryInterface's data.

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