Methods summary
public
|
|
protected
|
|
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
select( string|array $fields = '*' )
SELECT statement example:
select('contact., user.email)
select(array('contact.', 'user.email'))
SELECT statement example: select('contact., user.email)
select(array('contact.', 'user.email'))
Parameters
- $fields
string|array $fields
|
public
|
|
public
|
#
from( string|array $tables )
FROM statement example:
from('contact, user AS U')
from(array('contact', 'user AS U'))
FROM statement example: from('contact, user AS U') from(array('contact',
'user AS U'))
Parameters
- $tables
string|array $tables
|
public
|
#
buildConditions( string|array $conditions )
Build condition SQL
Parameters
- $conditions
string|array $conditions
|
public
|
#
where( string|array $conditions, array $params = array() )
WHERE statement
Parameters
- $conditions
string|array $conditions
- $params
array $params
|
public
|
#
orderBy( string|array $fields )
ORDER BY statement example:
orderBy('id DESC')
orderBy('firstname, lastname DESC')
ORDER BY statement example: orderBy('id DESC') orderBy('firstname, lastname
DESC')
Parameters
- $fields
string|array $fields
|
public
|
#
limit( integer $limit, integer $offset = null )
LIMIT statement
Parameters
- $limit
integer $limit
- $offset
integer $offset
|
public
|
#
offset( integer $offset )
OFFSET statement
Parameters
|
protected
|
#
anyJoin( string $type, string $table, string|array $conditions = '', array $params = array() )
Parameters
- $type
string $type LEFT JOIN|RIGHT JOIN...
- $table
string $table
- $conditions
string|array $conditions
- $params
array $params
|
public
|
#
join( string $table, string|array $conditions = '', array $params = array() )
JOIN statement
Parameters
- $table
string $table
- $conditions
string|array $conditions
- $params
array $params
|
public
|
#
leftJoin( string $table, string|array $conditions = '', array $params = array() )
LEFT JOIN statement
Parameters
- $table
string $table
- $conditions
string|array $conditions
- $params
array $params
|
public
|
#
rightJoin( string $table, string|array $condtions = '', array $params = array() )
RIGHT JOIN statement
Parameters
- $table
string $table
- $condtions
string|array $conditions
- $params
array $params
|
public
|
#
groupBy( string|array $fields )
GROUP BY statement
Parameters
- $fields
string|array $fields
|
public
|
#
having( string|array $conditions, array $params = array() )
HAVING statement
Parameters
- $conditions
string|array $conditions
- $params
array $params
|
public
|
#
union( string $sql )
UNION statement
Parameters
|
public
string
|
#
buildQuery( array $query = null )
Build query SQL
Parameters
- $query
array $query use $this->query if not specified
Returns
string
|
public
|
#
setSql( string $sql )
Set SQL for this command
Parameters
|
public
string
|
#
getSql( )
Get SQL for this command
Returns
string
|
protected
|
#
beginQuery( array $params = array() )
Prepare statement before query
Prepare statement before query
Parameters
|
public
PDOStatement
|
#
query( array $params = array() )
Query Statement cursor should be closed after fetching
data($statement->closeCursor)
Query Statement cursor should be closed after fetching
data($statement->closeCursor)
Parameters
Returns
PDOStatement
|
public
|
#
queryAll( array $params = array() )
Get query result as array
Get query result as array
Parameters
|
public
|
#
queryRow( array $params = array() )
Get first row of result
Parameters
|
public
|
#
queryColumn( array $params = array() )
Get first column of result set
Get first column of result set
Parameters
|
public
|
#
queryScalar( array $params = array() )
Get first column of first row of result set
Get first column of first row of result set
Parameters
|
public
|
#
execute( array $params = array() )
Execute statement and return rows affected
Execute statement and return rows affected
Parameters
|
public
integer
|
#
insert( string $table, array $values )
Insert data
Parameters
- $table
string $table
- $values
array $values
Returns
integer Rows affected, false on error
|
public
integer
|
#
update( string $table, string|array $values, string|array $conditions = '', array $params = array() )
Update table
Parameters
- $table
string $table
- $values
string|array $values
- $conditions
string|array $conditions
- $params
array $params
Returns
integer Rows affected, false on error
|
public
integer
|
#
delete( string $table, array $conditions = '', string|array $params = array() )
Delete
Parameters
- $table
string $table
- $conditions
array $values
- $params
string|array $conditions
Returns
integer Rows affected, false on error
|