PHP Class System\Database\query

Inheritance: extends System\Database\Builder
Afficher le fichier Open project: anchorcms/anchor-cms

Méthodes publiques

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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

apply() public méthode

Set the class name for fetch queries, return self for chaining
public apply ( $class ) : object
Résultat object

column() public méthode

Fetch a single column from the query
public column ( $columns = [], $column_number ) : string
Résultat string

count() public méthode

Run a count function on database query
public count ( ) : string
Résultat string

delete() public méthode

Delete a row in the database
public delete ( ) : integer
Résultat integer

fetch() public méthode

Fetch a single row from the query
public fetch ( $columns = null ) : object
Résultat object

get() public méthode

Fetch a result set from the query
public get ( $columns = null ) : object
Résultat object

group() public méthode

Add a group by column to the query
public group ( $column ) : object
Résultat object

insert() public méthode

Insert a row into the database
public insert ( $row ) : object
Résultat object

insert_get_id() public méthode

Insert a row into the database and return the inserted ID
public insert_get_id ( $row ) : integer
Résultat integer

join() public méthode

Add a table join to the query
public join ( $table, $left, $operator, $right, $type = 'INNER' ) : object
Résultat object

left_join() public méthode

Add a left table join to the query
public left_join ( $table, $left, $operator, $right ) : object
Résultat object

or_where() public méthode

Add a where clause to the query starting with OR
public or_where ( $column, $operator, $value ) : object
Résultat object

skip() public méthode

Set a row offset on the query
public skip ( $num ) : object
Résultat object

sort() public méthode

Add a sort by column to the query
public sort ( $column, $mode = 'ASC' ) : object
Résultat object

table() public static méthode

Create a new database query instance for chaining
public static table ( $table, $connection = null ) : object
Résultat object Query

take() public méthode

Set a row limit on the query
public take ( $num ) : object
Résultat object

update() public méthode

Update row in the database
public update ( $row ) : integer
Résultat integer

where() public méthode

Add a where clause to the query
public where ( $column, $operator, $value ) : object
Résultat object

where_in() public méthode

Add a where clause to the query starting with IN
public where_in ( $column, $values ) : object
Résultat object

Property Details

$bind public_oe property

Array values to bind to the query
public array $bind
Résultat array

$columns public_oe property

Array of columns to build the select
public array $columns
Résultat array

$connection public_oe property

Database connector object
public object $connection
Résultat object

$fetch_class public_oe property

The class name of the object to create when fetching from the database
public string $fetch_class
Résultat string

$groupby public_oe property

Columns to group by
public array $groupby
Résultat array

$join public_oe property

Array of table joins to build
public array $join
Résultat array

$limit public_oe property

Number of rows to limit
public int $limit
Résultat integer

$offset public_oe property

Number of rows to offset
public int $offset
Résultat integer

$sortby public_oe property

Columns to sort by
public array $sortby
Résultat array

$table public_oe property

The current database table
public string $table
Résultat string

$where public_oe property

Array of where clauses to build
public array $where
Résultat array