PHP Класс System\Database\query

Наследование: extends System\Database\Builder
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$bind array Array values to bind to the query
$columns array Array of columns to build the select
$connection object Database connector object
$fetch_class string The class name of the object to create when fetching from the database
$groupby array Columns to group by
$join array Array of table joins to build
$limit integer Number of rows to limit
$offset integer Number of rows to offset
$sortby array Columns to sort by
$table string The current database table
$where array Array of where clauses to build

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

Метод Описание
__construct ( $table, $connection = null ) Create a new database query instance
apply ( $class ) : object Set the class name for fetch queries, return self for chaining
column ( $columns = [], $column_number ) : string Fetch a single column from the query
count ( ) : string Run a count function on database query
delete ( ) : integer Delete a row in the database
fetch ( $columns = null ) : object Fetch a single row from the query
get ( $columns = null ) : object Fetch a result set from the query
group ( $column ) : object Add a group by column to the query
insert ( $row ) : object Insert a row into the database
insert_get_id ( $row ) : integer Insert a row into the database and return the inserted ID
join ( $table, $left, $operator, $right, $type = 'INNER' ) : object Add a table join to the query
left_join ( $table, $left, $operator, $right ) : object Add a left table join to the query
or_where ( $column, $operator, $value ) : object Add a where clause to the query starting with OR
skip ( $num ) : object Set a row offset on the query
sort ( $column, $mode = 'ASC' ) : object Add a sort by column to the query
table ( $table, $connection = null ) : object Create a new database query instance for chaining
take ( $num ) : object Set a row limit on the query
update ( $row ) : integer Update row in the database
where ( $column, $operator, $value ) : object Add a where clause to the query
where_in ( $column, $values ) : object Add a where clause to the query starting with IN

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

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

Create a new database query instance
public __construct ( $table, $connection = null )

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

Set the class name for fetch queries, return self for chaining
public apply ( $class ) : object
Результат object

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

Fetch a single column from the query
public column ( $columns = [], $column_number ) : string
Результат string

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

Run a count function on database query
public count ( ) : string
Результат string

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

Delete a row in the database
public delete ( ) : integer
Результат integer

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

Fetch a single row from the query
public fetch ( $columns = null ) : object
Результат object

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

Fetch a result set from the query
public get ( $columns = null ) : object
Результат object

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

Add a group by column to the query
public group ( $column ) : object
Результат object

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

Insert a row into the database
public insert ( $row ) : object
Результат object

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

Insert a row into the database and return the inserted ID
public insert_get_id ( $row ) : integer
Результат integer

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

Add a table join to the query
public join ( $table, $left, $operator, $right, $type = 'INNER' ) : object
Результат object

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

Add a left table join to the query
public left_join ( $table, $left, $operator, $right ) : object
Результат object

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

Add a where clause to the query starting with OR
public or_where ( $column, $operator, $value ) : object
Результат object

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

Set a row offset on the query
public skip ( $num ) : object
Результат object

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

Add a sort by column to the query
public sort ( $column, $mode = 'ASC' ) : object
Результат object

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

Create a new database query instance for chaining
public static table ( $table, $connection = null ) : object
Результат object Query

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

Set a row limit on the query
public take ( $num ) : object
Результат object

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

Update row in the database
public update ( $row ) : integer
Результат integer

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

Add a where clause to the query
public where ( $column, $operator, $value ) : object
Результат object

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

Add a where clause to the query starting with IN
public where_in ( $column, $values ) : object
Результат object

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

$bind публичное свойство

Array values to bind to the query
public array $bind
Результат array

$columns публичное свойство

Array of columns to build the select
public array $columns
Результат array

$connection публичное свойство

Database connector object
public object $connection
Результат object

$fetch_class публичное свойство

The class name of the object to create when fetching from the database
public string $fetch_class
Результат string

$groupby публичное свойство

Columns to group by
public array $groupby
Результат array

$join публичное свойство

Array of table joins to build
public array $join
Результат array

$limit публичное свойство

Number of rows to limit
public int $limit
Результат integer

$offset публичное свойство

Number of rows to offset
public int $offset
Результат integer

$sortby публичное свойство

Columns to sort by
public array $sortby
Результат array

$table публичное свойство

The current database table
public string $table
Результат string

$where публичное свойство

Array of where clauses to build
public array $where
Результат array