PHP 클래스 Habari\Query

또한 보기: Posts::get
파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$primary_table

보호된 프로퍼티들

프로퍼티 타입 설명
$fields
$groupby
$having
$join_params
$joins
$limit
$offset
$orderby

공개 메소드들

메소드 설명
__construct ( $primary_table = null ) Construct a Query
column ( ) : array Execute and return the first first field from each row of this query
create ( string $primary_table = null ) : Query Static helper method to create a new query instance
distinct ( boolean $set = true ) : Query Set whether only distinct results should be returned
from ( string $primary_table ) : Query Sets the primary table for the FROM statement
get ( ) : string Obtain the SQL used to execute this query
groupby ( string $value ) : Query Set the GROUP BY clause
having ( $value )
join ( string $join, array $parameters = [], string $alias = null ) : Query Adds a JOIN table
joined ( string $alias ) : boolean Discover if a table alias is already JOINed to this query
keyvalue ( ) : array Execute and return key-value pairs from this query
limit ( integer $value ) : Query Sets the LIMIT
new_param_name ( string $prefix = 'param' ) : string Obtain a parameter name with an optionally specified prefix that has not yet been used
offset ( integer $value ) : Query Sets the OFFSET
orderby ( string $value ) : Query Set the ORDER BY clause
params ( ) : array Obtain the parameter values needed for the query
results ( string $class = null ) : array Execute and return the returns of this query
row ( string $class = null ) : object Execute and return the first row of this query
select ( array | string $fields ) : Query Adds fields to the SELECT statement
set_select ( array | string $fields ) : Query Sets fields for the SELECT statement
value ( ) : object Execute and return the first row of this query
where ( string $operator = 'AND' ) : QueryWhere Create and/or return a QueryWhere object representing the where clause of this query

메소드 상세

__construct() 공개 메소드

Construct a Query
public __construct ( $primary_table = null )
$primary_table Name of the primary table (use {table} syntax to expand)

column() 공개 메소드

Execute and return the first first field from each row of this query
public column ( ) : array
리턴 array The result array of values

create() 공개 정적인 메소드

Static helper method to create a new query instance
public static create ( string $primary_table = null ) : Query
$primary_table string Name of the primary table (use {table} syntax to expand)
리턴 Query A new instance of the Query class

distinct() 공개 메소드

Set whether only distinct results should be returned
public distinct ( boolean $set = true ) : Query
$set boolean True if the result set should be distinct
리턴 Query Returns $this for fluid interface

from() 공개 메소드

Sets the primary table for the FROM statement
public from ( string $primary_table ) : Query
$primary_table string The primary table from which to select
리턴 Query Returns $this for fluid interface

get() 공개 메소드

Obtain the SQL used to execute this query
public get ( ) : string
리턴 string The SQL to execute

groupby() 공개 메소드

Set the GROUP BY clause
public groupby ( string $value ) : Query
$value string The GROUP BY clause
리턴 Query Returns $this for fluid interface

having() 공개 메소드

public having ( $value )

join() 공개 메소드

Adds a JOIN table
public join ( string $join, array $parameters = [], string $alias = null ) : Query
$join string The table to create a join with
$parameters array An array of parameters on which the JOIN is built
$alias string An optional alias for the joined table
리턴 Query Returns $this for fluid interface

joined() 공개 메소드

Discover if a table alias is already JOINed to this query
public joined ( string $alias ) : boolean
$alias string The name of a JOIN table alias
리턴 boolean true if the alias was used for a join

keyvalue() 공개 메소드

Execute and return key-value pairs from this query
public keyvalue ( ) : array
리턴 array The results array of QueryRecords or the specified class

limit() 공개 메소드

Sets the LIMIT
public limit ( integer $value ) : Query
$value integer The LIMIT
리턴 Query Returns $this for fluid interface

new_param_name() 공개 정적인 메소드

Obtain a parameter name with an optionally specified prefix that has not yet been used
public static new_param_name ( string $prefix = 'param' ) : string
$prefix string An optional prefix to use for a new parameter
리턴 string the new parameter

offset() 공개 메소드

Sets the OFFSET
public offset ( integer $value ) : Query
$value integer The OFFSET
리턴 Query Returns $this for fluid interface

orderby() 공개 메소드

Set the ORDER BY clause
public orderby ( string $value ) : Query
$value string The ORDER BY clause
리턴 Query Returns $this for fluid interface

params() 공개 메소드

Obtain the parameter values needed for the query
public params ( ) : array
리턴 array An associative array containing the parameters of the query

results() 공개 메소드

Execute and return the returns of this query
public results ( string $class = null ) : array
$class string The optional class to return results as
리턴 array The results array of QueryRecords or the specified class

row() 공개 메소드

Execute and return the first row of this query
public row ( string $class = null ) : object
$class string The optional class to return results as
리턴 object The result object, a QueryRecord or the specified class

select() 공개 메소드

Adds fields to the SELECT statement
public select ( array | string $fields ) : Query
$fields array | string A field or list of fields to add to existing select'ed fields
리턴 Query Returns $this for fluid interface

set_select() 공개 메소드

Sets fields for the SELECT statement
public set_select ( array | string $fields ) : Query
$fields array | string A field or list of fields to set as the fields to select, replaces existing selected fields
리턴 Query Returns $this for fluid interface

value() 공개 메소드

Execute and return the first row of this query
public value ( ) : object
리턴 object The result object, a QueryRecord or the specified class

where() 공개 메소드

Create and/or return a QueryWhere object representing the where clause of this query
public where ( string $operator = 'AND' ) : QueryWhere
$operator string The operator (AND/OR) to use between expressions in this clause
리턴 QueryWhere An instance of the where clause for this query

프로퍼티 상세

$fields 보호되어 있는 프로퍼티

protected $fields

$groupby 보호되어 있는 프로퍼티

protected $groupby

$having 보호되어 있는 프로퍼티

protected $having

$join_params 보호되어 있는 프로퍼티

protected $join_params

$joins 보호되어 있는 프로퍼티

protected $joins

$limit 보호되어 있는 프로퍼티

protected $limit

$offset 보호되어 있는 프로퍼티

protected $offset

$orderby 보호되어 있는 프로퍼티

protected $orderby

$primary_table 공개적으로 프로퍼티

public $primary_table