Database: ezcQuerySelectSqlite
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcQuerySelectSqlite
|
SQLite specific implementation of ezcQuery. [
source]
This class reimplements methods where SQLite differs from the standard implementation in ezcQuery. The only difference is the right join syntax.
Parents
ezcQuery
|
--ezcQuerySelect
|
--ezcQuerySelectSqlite
Inherited Constants
From
ezcQuerySelect:
Member Variables
|
protected mixed |
$fromTables
= array()
Store tables that appear in FROM clause. |
|
protected mixed |
$rightJoins
= array( null )
Store info for building emulation of right joins in FROM clause. |
Inherited Member Variables
From
ezcQuerySelect:
From
ezcQuery:
Method Summary
|
public ezcQuerySelectSqlite |
__construct(
$db )
Constructs a new ezcQuerySelectSqlite object. |
|
public a |
from(
0 )
Select which tables you want to select from. |
|
public void |
reset(
)
Resets the query object for reuse. |
|
public string |
rightJoin(
$table1, $table2, $column1, $column2, $condition )
Returns the SQL for a right join or prepares $fromString for a right join. |
Inherited Methods
From
ezcQuerySelect :
From
ezcQuery :
Methods
__construct
ezcQuerySelectSqlite __construct(
$db )
Constructs a new ezcQuerySelectSqlite object.
Parameters
| Name |
Type |
Description |
$db |
PDO |
|
Redefinition of
from
a from(
string|array(string)
0 )
Select which tables you want to select from.
from() accepts an arbitrary number of parameters. Each parameter must contain either the name of a table or an array containing the names of tables.. from() could be invoked several times. All provided arguments added to the end of $fromString.
Additional actions performed to emulate right joins in SQLite.
Example:
1. // the following code will produce the SQL
2. // SELECT id FROM t2 LEFT JOIN t1 ON t1.id = t2.id
3. $q->select( 'id' )->from( $q->rightJoin( 't1', 't2', 't1.id', 't2.id' ) );
4.
5. // the following code will produce the same SQL
6. // SELECT id FROM t2 LEFT JOIN t1 ON t1.id = t2.id
7. $q->select( 'id' )->from( 't1' )->rightJoin( 't2', 't1.id', 't2.id' );
Parameters
| Name |
Type |
Description |
0 |
string|array(string) |
Either a string with a table name or an array of table names. |
Throws
| Class | Description |
ezcQueryVariableParameterException |
if called with no parameters. |
Redefinition of
reset
void reset(
)
Resets the query object for reuse.
Redefinition of
rightJoin
string rightJoin(
string
$table1, string
$table2, string
$column1, string
$column2, string
$condition )
Returns the SQL for a right join or prepares $fromString for a right join.
SQLite doesn't support a RIGHT JOIN directly, so it's rewrited to a LEFT JOIN of tables in reverse order.
This method could be used in three forms:
- rightJoin( 't1', 't2', 't1.id', 't2.id' ) takes 4 string arguments and return SQL string
Parameters
| Name |
Type |
Description |
$table1 |
string |
the name of the table to join with |
$table2 |
string |
the name of the table to join. The name of table to join with should be set in previous call to from(). |
$column1 |
string |
the column to join with |
$column2 |
string |
the column to join on |
$condition |
string |
the string with join condition returned by ezcQueryExpression. |
Redefinition of
Last updated: Thu, 01 Nov 2007