PHP Class Pop\Db\Sql

Author: Nick Sagona, III ([email protected])
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Свойство Type Description
$alias string Alias name for sub-queries
$clause mixed SQL clause object
$db Db Database object
$dbType integer Database type
$quoteIdType integer ID quote type
$sql string SQL statement
$table string Current table

Méthodes publiques

Méthode Description
__construct ( Db $db, mixed $table = null, string $alias = null ) : Sql Constructor
__toString ( ) : string Method to return the SQL as a string
adapter ( ) : AbstractAdapter Get the current database object's adapter.
delete ( ) : Update Create a delete statement
factory ( Db $db, mixed $table = null, string $alias = null ) : Sql Static method to instantiate the SQL object and return itself to facilitate chaining methods together.
getAlias ( ) : string Get the alias name.
getDb ( ) : Db Get the current database object.
getDbType ( ) : integer Get the current database type.
getQuoteId ( ) : integer Get the quote ID type
getSql ( ) : string Get the current SQL statement string.
getTable ( ) : string Get the current table.
hasAlias ( ) : boolean Determine if the Sql object has an alias name
hasTable ( ) : boolean Determine if the Sql object has a table set
insert ( array $columns = null ) : Insert Create a insert statement
quote ( string $value ) : string Quote the value with single quotes
quoteId ( string $id ) : string Quote the value with the quoted identifier
render ( boolean $ret = false ) : mixed Render SQL string
select ( mixed $columns = null ) : Select Create a select statement
setAlias ( string $alias = null ) : Sql Set alias name
setDb ( Db $db ) : Sql Set the database object
setQuoteId ( integer $type = Pop\Db\Sql::NO_QUOTE ) : Sql Set the quote ID type
setTable ( mixed $table = null ) : Sql Set current table to operate on.
update ( array $columns = null ) : Update Create a update statement

Method Details

__construct() public méthode

Instantiate the SQL object.
public __construct ( Db $db, mixed $table = null, string $alias = null ) : Sql
$db Db
$table mixed
$alias string
Résultat Sql

__toString() public méthode

Method to return the SQL as a string
public __toString ( ) : string
Résultat string

adapter() public méthode

Get the current database object's adapter.
public adapter ( ) : AbstractAdapter
Résultat Pop\Db\Adapter\AbstractAdapter

delete() public méthode

Create a delete statement
public delete ( ) : Update
Résultat Pop\Db\Sql\Update

factory() public static méthode

Static method to instantiate the SQL object and return itself to facilitate chaining methods together.
public static factory ( Db $db, mixed $table = null, string $alias = null ) : Sql
$db Db
$table mixed
$alias string
Résultat Sql

getAlias() public méthode

Get the alias name.
public getAlias ( ) : string
Résultat string

getDb() public méthode

Get the current database object.
public getDb ( ) : Db
Résultat Db

getDbType() public méthode

Get the current database type.
public getDbType ( ) : integer
Résultat integer

getQuoteId() public méthode

Get the quote ID type
public getQuoteId ( ) : integer
Résultat integer

getSql() public méthode

Get the current SQL statement string.
public getSql ( ) : string
Résultat string

getTable() public méthode

Get the current table.
public getTable ( ) : string
Résultat string

hasAlias() public méthode

Determine if the Sql object has an alias name
public hasAlias ( ) : boolean
Résultat boolean

hasTable() public méthode

Determine if the Sql object has a table set
public hasTable ( ) : boolean
Résultat boolean

insert() public méthode

Create a insert statement
public insert ( array $columns = null ) : Insert
$columns array
Résultat Pop\Db\Sql\Insert

quote() public méthode

Quote the value with single quotes
public quote ( string $value ) : string
$value string
Résultat string

quoteId() public méthode

Quote the value with the quoted identifier
public quoteId ( string $id ) : string
$id string
Résultat string

render() public méthode

Render SQL string
public render ( boolean $ret = false ) : mixed
$ret boolean
Résultat mixed

select() public méthode

Create a select statement
public select ( mixed $columns = null ) : Select
$columns mixed
Résultat Pop\Db\Sql\Select

setAlias() public méthode

Set alias name
public setAlias ( string $alias = null ) : Sql
$alias string
Résultat Sql

setDb() public méthode

Set the database object
public setDb ( Db $db ) : Sql
$db Db
Résultat Sql

setQuoteId() public méthode

Set the quote ID type
public setQuoteId ( integer $type = Pop\Db\Sql::NO_QUOTE ) : Sql
$type integer
Résultat Sql

setTable() public méthode

Set current table to operate on.
public setTable ( mixed $table = null ) : Sql
$table mixed
Résultat Sql

update() public méthode

Create a update statement
public update ( array $columns = null ) : Update
$columns array
Résultat Pop\Db\Sql\Update

Property Details

$alias protected_oe property

Alias name for sub-queries
protected string $alias
Résultat string

$clause protected_oe property

SQL clause object
protected mixed $clause
Résultat mixed

$db protected_oe property

Database object
protected Db,Pop\Db $db
Résultat Db

$dbType protected_oe property

Database type
protected int $dbType
Résultat integer

$quoteIdType protected_oe property

ID quote type
protected int $quoteIdType
Résultat integer

$sql protected_oe property

SQL statement
protected string $sql
Résultat string

$table protected_oe property

Current table
protected string $table
Résultat string