Database: ezcQueryExpressionSqlite
[ ]
[ Oracle setup ]
[ ]
[ ]
[ ]
[ ]
Class: ezcQueryExpressionSqlite
|
The ezcQueryExpressionSqlite class is used to create SQL expression for SQLite. [
source]
This class reimplements the methods that have a different syntax in SQLite (substr) and contains PHP implementations of functions that are registered with SQLite with it's PDO::sqliteRegisterFunction() method.
Parents
ezcQueryExpression
|
--ezcQueryExpressionSqlite
Member Variables
|
protected array(string=>string) |
$intervalMap
= array( 'SECOND' => 'seconds', 'MINUTE' => 'minutes', 'HOUR' => 'hours', 'DAY' => 'days', 'MONTH' => 'months', 'YEAR' => 'years', )
Contains an interval map from generic intervals to SQLite native intervals. |
Inherited Member Variables
From
ezcQueryExpression:
Method Summary
|
public string |
bitXor(
$value1, $value2 )
Returns the SQL that performs the bitwise XOR on two values. |
|
public string |
dateAdd(
$column, $expr, $type )
Returns the SQL that adds an interval to a timestamp value. |
|
public string |
dateExtract(
$column, $type )
Returns the SQL that extracts parts from a timestamp value. |
|
public string |
dateSub(
$column, $expr, $type )
Returns the SQL that subtracts an interval from a timestamp value. |
|
public string |
in(
$column, $... )
Returns the SQL to check if a value is one in a set of given values.. |
|
public string |
now(
)
Returns the current system date and time. |
|
public string |
subString(
$value, $from, [$len = null] )
Returns part of a string. |
|
public string |
unixTimestamp(
$column )
Returns the SQL that converts a timestamp value to a unix timestamp. |
Inherited Methods
From
ezcQueryExpression :
Methods
bitXor
string bitXor(
string
$value1, string
$value2 )
Returns the SQL that performs the bitwise XOR on two values.
Parameters
| Name |
Type |
Description |
$value1 |
string |
|
$value2 |
string |
|
Redefinition of
dateAdd
string dateAdd(
string
$column, numeric
$expr, string
$type )
Returns the SQL that adds an interval to a timestamp value.
Parameters
| Name |
Type |
Description |
$column |
string |
|
$expr |
numeric |
|
$type |
string |
one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR |
Redefinition of
dateExtract
string dateExtract(
string
$column, string
$type )
Returns the SQL that extracts parts from a timestamp value.
Parameters
| Name |
Type |
Description |
$column |
string |
|
$type |
string |
one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR |
Redefinition of
dateSub
string dateSub(
string
$column, numeric
$expr, string
$type )
Returns the SQL that subtracts an interval from a timestamp value.
Parameters
| Name |
Type |
Description |
$column |
string |
|
$expr |
numeric |
|
$type |
string |
one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR |
Redefinition of
in
string in(
string
$column, string|array(string)
$... )
Returns the SQL to check if a value is one in a set of given values..
in() accepts an arbitrary number of parameters. The first parameter must always specify the value that should be matched against. Successive parameters must contain a logical expression or an array with logical expressions. These expressions will be matched against the first parameter.
Example:
1. $q->select( '*' )->from( 'table' )
2. ->where( $q->expr->in( 'id', 1, 2, 3 ) );
Optimization note: Call setQuotingValues( false ) before using in() with big lists of numeric parameters. This avoid redundant quoting of numbers in resulting SQL query and saves time of converting strings to numbers inside RDBMS.
Parameters
| Name |
Type |
Description |
$column |
string |
the value that should be matched against |
$... |
string|array(string) |
values that will be matched against $column |
Throws
| Class | Description |
ezcQueryVariableParameterException |
if called with less than two parameters. |
ezcQueryInvalidParameterException |
if the 2nd parameter is an empty array. |
Redefinition of
now
string now(
)
Returns the current system date and time.
Redefinition of
subString
string subString(
string
$value, int
$from, [int
$len = null] )
Returns part of a string.
Note: Not SQL92, but common functionality. SQLite only supports the 3 parameter variant of this function, so we are using 2^30-1 as artificial length in that case.
Parameters
| Name |
Type |
Description |
$value |
string |
the target $value the string or the string column. |
$from |
int |
extract from this characeter. |
$len |
int |
extract this amount of characters. |
Redefinition of
unixTimestamp
string unixTimestamp(
string
$column )
Returns the SQL that converts a timestamp value to a unix timestamp.
Parameters
| Name |
Type |
Description |
$column |
string |
|
Redefinition of
Last updated: Mon, 10 Nov 2008