PHP Class Drivers\Abstraction\Sql

Datei anzeigen Open project: panada/panada

Public Properties

Property Type Description
$clientFlags
$insertId return data type option: object, array and iterator (pointer)
$instantiateClass
$newLink
$persistentConnection

Protected Properties

Property Type Description
$column
$config
$connection
$criteria
$distinct
$groupBy
$isHaving
$isQuotes
$joins
$joinsOn
$joinsType
$lastError
$lastQuery
$limit
$link
$offset
$order
$orderBy
$returnType
$tables
$throwError

Public Methods

Method Description
command ( ) : string Build the SQL statement.
delete ( $table, $where = null ) : boolean Abstraction for delete.
distinct ( ) : object API for ".
fetchAs ( string $returnType = 'object' ) : object Flag to get return type. The options is: object, array and iterator.
from ( ) : object API for ".
getAll ( $table = false, $where = [], $fields = [], $returnType = false ) : object Previously called get_results.
getLastQuery ( ) : string Get last query.
getOne ( $table = false, $where = [], $fields = [], $returnType = false ) : object Previously called get_row.
getVar ( $query = null ) : string | integer Get value directly from single field. Previusly called get_var().
groupBy ( ) : object API for ".
having ( string $column, string $operator, string $value, mix $separator = false ) API for ".
insert ( string $table, array $data = [] ) : boolean Abstraction for insert.
join ( string $table, string $type = null ) API for ".
limit ( $limit, $offset = null ) : object API for ".
on ( string $column, string $operator, string $value, mix $separator = false ) API for ".
orderBy ( $column, $order = null ) : object API for ".
select ( ) : object API for "SELECT .
setThrowError ( boolean $set = false ) Throw the error instead handle it automaticly.
update ( string $table, array $dat, array $where = null ) : boolean Abstraction for update.
where ( string $column, string $operator, string $value, string $separator = false ) : object API for ".

Protected Methods

Method Description
createCriteria ( string $column, string $operator, string $value, mix $separator ) Create criteria condition. It use in on, where and having method.
printError ( ) : string Print the error.

Method Details

command() public method

Build the SQL statement.
public command ( ) : string
return string The complited SQL statement

createCriteria() protected method

Create criteria condition. It use in on, where and having method.
protected createCriteria ( string $column, string $operator, string $value, mix $separator )
$column string
$operator string
$value string
$separator mix

delete() public method

Abstraction for delete.
public delete ( $table, $where = null ) : boolean
return boolean

distinct() public method

.. DISTINCT " statement.
public distinct ( ) : object
return object

fetchAs() public method

Flag to get return type. The options is: object, array and iterator.
public fetchAs ( string $returnType = 'object' ) : object
$returnType string
return object

from() public method

..FROM ... " statement.
public from ( ) : object
return object

getAll() public method

Previously called get_results.
public getAll ( $table = false, $where = [], $fields = [], $returnType = false ) : object
return object

getLastQuery() public method

Get last query.
public getLastQuery ( ) : string
return string

getOne() public method

Previously called get_row.
public getOne ( $table = false, $where = [], $fields = [], $returnType = false ) : object
return object

getVar() public method

Get value directly from single field. Previusly called get_var().
public getVar ( $query = null ) : string | integer
return string | integer Depen on it record value.

groupBy() public method

.. GROUP BY ... " statement.
public groupBy ( ) : object
return object

having() public method

.. HAVING..." statement.
public having ( string $column, string $operator, string $value, mix $separator = false )
$column string
$operator string
$value string
$separator mix

insert() public method

Abstraction for insert.
public insert ( string $table, array $data = [] ) : boolean
$table string
$data array
return boolean

join() public method

.. JOIN ..." statement.
public join ( string $table, string $type = null )
$table string Table to join
$type string Type of join: LEFT, RIGHT, INNER

limit() public method

.. LIMIT ..." statement.
public limit ( $limit, $offset = null ) : object
return object

on() public method

.. JOIN ON..." statement.
public on ( string $column, string $operator, string $value, mix $separator = false )
$column string
$operator string
$value string
$separator mix

orderBy() public method

.. ORDER BY..." statement.
public orderBy ( $column, $order = null ) : object
return object

printError() protected method

Print the error.
protected printError ( ) : string
return string

select() public method

.. " statement.
public select ( ) : object
return object

setThrowError() public method

User should catch this error for there own purpose.
public setThrowError ( boolean $set = false )
$set boolean

update() public method

Abstraction for update.
public update ( string $table, array $dat, array $where = null ) : boolean
$table string
$dat array
$where array
return boolean

where() public method

.. WHERE ... " statement.
public where ( string $column, string $operator, string $value, string $separator = false ) : object
$column string Column name
$operator string SQL operator string: =,<,>,<= dll
$value string Where value
$separator string Such as: AND, OR
return object

Property Details

$clientFlags public_oe property

public $clientFlags

$column protected_oe property

protected $column

$config protected_oe property

protected $config

$connection protected_oe property

protected $connection

$criteria protected_oe property

protected $criteria

$distinct protected_oe property

protected $distinct

$groupBy protected_oe property

protected $groupBy

$insertId public_oe property

return data type option: object, array and iterator (pointer)
public $insertId

$instantiateClass public_oe property

public $instantiateClass

$isHaving protected_oe property

protected $isHaving

$isQuotes protected_oe property

protected $isQuotes

$joins protected_oe property

protected $joins

$joinsOn protected_oe property

protected $joinsOn

$joinsType protected_oe property

protected $joinsType

$lastError protected_oe property

protected $lastError

$lastQuery protected_oe property

protected $lastQuery

$limit protected_oe property

protected $limit

$offset protected_oe property

protected $offset

$order protected_oe property

protected $order

$orderBy protected_oe property

protected $orderBy

$persistentConnection public_oe property

public $persistentConnection

$returnType protected_oe property

protected $returnType

$tables protected_oe property

protected $tables

$throwError protected_oe property

protected $throwError