Bytes
class Bytes implements Serializable (View source)
\Aerospike\Bytes is a utility for wrapping PHP strings containing potentially harmful bytes such as \0. By wrapping the binary-string, the Aerospike client will serialize the data into an as_bytes rather than an as_string.
This ensures that the string will not get truncated or otherwise lose data. The main difference is that strings in the Aerospike cluster can have a secondary index built over them, and queries executed against the index, while bytes data cannot.
Properties
string | $s | The container for the binary-string |
Methods
Constructor for \Aerospike\Bytes class.
Returns a serialized representation of the binary-string.
Re-wraps the binary-string when called by unserialize().
Returns the binary-string held in the \Aerospike\Bytes object.
Details
__construct(string $bin_str)
Constructor for \Aerospike\Bytes class.
string|null
serialize()
Returns a serialized representation of the binary-string.
Called by serialize()
void
unserialize(string $bin_str)
Re-wraps the binary-string when called by unserialize().
string
__toString()
Returns the binary-string held in the \Aerospike\Bytes object.
static string
unwrap(Bytes $bytes_wrap)
Unwraps an \Aerospike\Bytes object, returning the binary-string inside.