CodeIgniter v4.6 API

DatetimeCast extends BaseCast
in package

Class DatetimeCast

(PHP) [Time --> string] --> (DB driver) --> (DB column) datetime [ <-- string] <-- (DB driver) <-- (DB column) datetime

Table of Contents

Methods

get()  : mixed
Takes a value from DataSource, returns its value for PHP.
set()  : mixed
Takes a PHP value, returns its value for DataSource.
getDateTimeFormat()  : string
Gets DateTime format from the DB connection.
invalidTypeValueError()  : never

Methods

get()

Takes a value from DataSource, returns its value for PHP.

public static get(mixed $value[, array<string|int, mixed> $params = [] ][, object|null $helper = null ]) : mixed
Parameters
$value : mixed

Data from database driver

$params : array<string|int, mixed> = []

Additional param

$helper : object|null = null

Helper object. E.g., database connection

Return values
mixed

PHP native value

set()

Takes a PHP value, returns its value for DataSource.

public static set(mixed $value[, array<string|int, mixed> $params = [] ][, object|null $helper = null ]) : mixed
Parameters
$value : mixed

PHP native value

$params : array<string|int, mixed> = []

Additional param

$helper : object|null = null

Helper object. E.g., database connection

Return values
mixed

Data to pass to database driver

getDateTimeFormat()

Gets DateTime format from the DB connection.

protected static getDateTimeFormat(array<int, string> $params, BaseConnection $db) : string
Parameters
$params : array<int, string>

Additional param

$db : BaseConnection
Return values
string

invalidTypeValueError()

protected static invalidTypeValueError(mixed $value) : never
Parameters
$value : mixed
Return values
never

        
On this page

Search results