PHP Класс Pop\Db\Sql

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

Instantiate the SQL object.
public __construct ( Db $db, mixed $table = null, string $alias = null ) : Sql
$db Db
$table mixed
$alias string
Результат Sql

__toString() публичный Метод

Method to return the SQL as a string
public __toString ( ) : string
Результат string

adapter() публичный Метод

Get the current database object's adapter.
public adapter ( ) : AbstractAdapter
Результат Pop\Db\Adapter\AbstractAdapter

delete() публичный Метод

Create a delete statement
public delete ( ) : Update
Результат Pop\Db\Sql\Update

factory() публичный статический Метод

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
Результат Sql

getAlias() публичный Метод

Get the alias name.
public getAlias ( ) : string
Результат string

getDb() публичный Метод

Get the current database object.
public getDb ( ) : Db
Результат Db

getDbType() публичный Метод

Get the current database type.
public getDbType ( ) : integer
Результат integer

getQuoteId() публичный Метод

Get the quote ID type
public getQuoteId ( ) : integer
Результат integer

getSql() публичный Метод

Get the current SQL statement string.
public getSql ( ) : string
Результат string

getTable() публичный Метод

Get the current table.
public getTable ( ) : string
Результат string

hasAlias() публичный Метод

Determine if the Sql object has an alias name
public hasAlias ( ) : boolean
Результат boolean

hasTable() публичный Метод

Determine if the Sql object has a table set
public hasTable ( ) : boolean
Результат boolean

insert() публичный Метод

Create a insert statement
public insert ( array $columns = null ) : Insert
$columns array
Результат Pop\Db\Sql\Insert

quote() публичный Метод

Quote the value with single quotes
public quote ( string $value ) : string
$value string
Результат string

quoteId() публичный Метод

Quote the value with the quoted identifier
public quoteId ( string $id ) : string
$id string
Результат string

render() публичный Метод

Render SQL string
public render ( boolean $ret = false ) : mixed
$ret boolean
Результат mixed

select() публичный Метод

Create a select statement
public select ( mixed $columns = null ) : Select
$columns mixed
Результат Pop\Db\Sql\Select

setAlias() публичный Метод

Set alias name
public setAlias ( string $alias = null ) : Sql
$alias string
Результат Sql

setDb() публичный Метод

Set the database object
public setDb ( Db $db ) : Sql
$db Db
Результат Sql

setQuoteId() публичный Метод

Set the quote ID type
public setQuoteId ( integer $type = Pop\Db\Sql::NO_QUOTE ) : Sql
$type integer
Результат Sql

setTable() публичный Метод

Set current table to operate on.
public setTable ( mixed $table = null ) : Sql
$table mixed
Результат Sql

update() публичный Метод

Create a update statement
public update ( array $columns = null ) : Update
$columns array
Результат Pop\Db\Sql\Update

Описание свойств

$alias защищенное свойство

Alias name for sub-queries
protected string $alias
Результат string

$clause защищенное свойство

SQL clause object
protected mixed $clause
Результат mixed

$db защищенное свойство

Database object
protected Db,Pop\Db $db
Результат Db

$dbType защищенное свойство

Database type
protected int $dbType
Результат integer

$quoteIdType защищенное свойство

ID quote type
protected int $quoteIdType
Результат integer

$sql защищенное свойство

SQL statement
protected string $sql
Результат string

$table защищенное свойство

Current table
protected string $table
Результат string