Fr3nch13/CakePHP Utilities

BoolType extends BaseType
in package
implements BatchCastingInterface

Bool type converter.

Use to convert bool data between PHP and the database types.

Table of Contents

Interfaces

BatchCastingInterface
Denotes type objects capable of converting many values from their original database representation to php values.

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.
manyToPHP()  : array<string, mixed>
Returns an array of the values converted to the PHP representation of this type.
marshal()  : bool|null
Marshals request data into PHP booleans.
newId()  : mixed
Generate a new primary key value for a given type.
toDatabase()  : bool|null
Convert bool data into the database format.
toPHP()  : bool|null
Convert bool values to PHP booleans
toStatement()  : int
Get the correct PDO binding type for bool 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
inheritDoc
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
inheritDoc
Return values
string|null

The type identifier name for this object.

manyToPHP()

Returns an array of the values converted to the PHP representation of this type.

public manyToPHP(array<string|int, mixed> $values, array<string|int, mixed> $fields, DriverInterface $driver) : array<string, mixed>
Parameters
$values : array<string|int, mixed>

The original array of values containing the fields to be casted

$fields : array<string|int, mixed>

The field keys to cast

$driver : DriverInterface

Object from which database preferences and configuration will be extracted.

Tags
inheritDoc
Return values
array<string, mixed>

marshal()

Marshals request data into PHP booleans.

public marshal(mixed $value) : bool|null
Parameters
$value : mixed

The value to convert.

Return values
bool|null

Converted value.

newId()

Generate a new primary key value for a given type.

public newId() : mixed
Tags
inheritDoc
Return values
mixed

A new primary key value.

toDatabase()

Convert bool data into the database format.

public toDatabase(mixed $value, DriverInterface $driver) : bool|null
Parameters
$value : mixed

The value to convert.

$driver : DriverInterface

The driver instance to convert with.

Return values
bool|null

toPHP()

Convert bool values to PHP booleans

public toPHP(mixed $value, DriverInterface $driver) : bool|null
Parameters
$value : mixed

The value to convert.

$driver : DriverInterface

The driver instance to convert with.

Return values
bool|null

toStatement()

Get the correct PDO binding type for bool data.

public toStatement(mixed $value, DriverInterface $driver) : int
Parameters
$value : mixed

The value being bound.

$driver : DriverInterface

The driver.

Return values
int

        
On this page

Search results