BinaryType
extends BaseType
in package
Binary type converter.
Use to convert binary data between PHP and the database types.
Table of Contents
Properties
- $_name : string|null
- Identifier name for this type
Methods
- __construct() : mixed
- Constructor
- getBaseType() : string|null
- Returns the base type name that this class is inheriting.
- getName() : string|null
- Returns type identifier name for this object.
- marshal() : mixed
- Marshals flat data into PHP objects.
- newId() : mixed
- Generate a new primary key value for a given type.
- toDatabase() : resource|string
- Convert binary data into the database format.
- toPHP() : resource|null
- Convert binary into resource handles
- toStatement() : int
- Get the correct PDO binding type for Binary data.
Properties
$_name
Identifier name for this type
protected
string|null
$_name
Methods
__construct()
Constructor
public
__construct([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
-
The name identifying this type
getBaseType()
Returns the base type name that this class is inheriting.
public
getBaseType() : string|null
Tags
Return values
string|null —The base type name that this class is inheriting.
getName()
Returns type identifier name for this object.
public
getName() : string|null
Tags
Return values
string|null —The type identifier name for this object.
marshal()
Marshals flat data into PHP objects.
public
marshal(mixed $value) : mixed
Most useful for converting request data into PHP objects that make sense for the rest of the ORM/Database layers.
Parameters
- $value : mixed
-
The value to convert.
Return values
mixed —Converted value.
newId()
Generate a new primary key value for a given type.
public
newId() : mixed
Tags
Return values
mixed —A new primary key value.
toDatabase()
Convert binary data into the database format.
public
toDatabase(mixed $value, DriverInterface $driver) : resource|string
Binary data is not altered before being inserted into the database. As PDO will handle reading file handles.
Parameters
- $value : mixed
-
The value to convert.
- $driver : DriverInterface
-
The driver instance to convert with.
Return values
resource|stringtoPHP()
Convert binary into resource handles
public
toPHP(mixed $value, DriverInterface $driver) : resource|null
Parameters
- $value : mixed
-
The value to convert.
- $driver : DriverInterface
-
The driver instance to convert with.
Tags
Return values
resource|nulltoStatement()
Get the correct PDO binding type for Binary data.
public
toStatement(mixed $value, DriverInterface $driver) : int
Parameters
- $value : mixed
-
The value being bound.
- $driver : DriverInterface
-
The driver.