PHP 클래스 Horde_Rdo_Query, horde

파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$conjunction string
$distinct boolean
$fields array
$limit integer
$limitOffset integer
$mapper Horde_Rdo_Mapper
$relationships array
$tests array

보호된 프로퍼티들

프로퍼티 타입 설명
$_aliasCount integer
$_aliases array
$_sortby array

공개 메소드들

메소드 설명
__construct ( Horde_Rdo_Mapper $mapper = null ) Constructor.
__get ( string $key ) Accessor for any fields that we want some logic around.
addFields ( array $fields, string $fieldPrefix = null ) : Horde_Rdo_Query Adds fields to return with the query.
addRelationship ( string $relationship, array $args ) : Horde_Rdo_Query Adds a relationship type to a query.
addTest ( $field, $test, $value )
clearSort ( )
combineWith ( string $conjunction )
create ( mixed $query, Horde_Rdo_Mapper $mapper = null ) : Horde_Rdo_Query Turn any of the acceptable query shorthands into a full Horde_Rdo_Query object. If you pass an existing Horde_Rdo_Query object in, it will be cloned before it's returned so that it can be safely modified.
distinct ( boolean $distinct ) : Horde_Rdo_Query Makes the query return only distinct (different) values.
getQuery ( ) : array Query generator.
limit ( integer $limit, integer $offset = null ) Restrict the query to a subset of the results.
setFields ( array $fields, string $fieldPrefix = null ) : Horde_Rdo_Query Sets the fields to return with the query.
setMapper ( Horde_Rdo_Mapper $mapper ) : Horde_Rdo_Query
sortBy ( string $sort ) Add a sorting rule.

보호된 메소드들

메소드 설명
_alias ( $tableName ) Get a unique table alias
_fillJoinPlaceholders ( Horde_Rdo_Mapper $m1, Horde_Rdo_Mapper $m2, array $query ) : array Take a query array and replace @field@ placeholders with values that will match in the load query.
_from ( &$sql, &$bindParams )
_join ( &$sql, &$bindParams )
_limit ( &$sql, &$bindParams )
_orderBy ( &$sql, &$bindParams )
_prefix ( &$fieldName, $key, $prefix ) Callback for array_walk to prefix all elements of an array with a given prefix.
_select ( &$sql, &$bindParams )
_where ( &$sql, &$bindParams )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Horde_Rdo_Mapper $mapper = null )
$mapper Horde_Rdo_Mapper Rdo mapper base class

__get() 공개 메소드

Accessor for any fields that we want some logic around.
public __get ( string $key )
$key string

_alias() 보호된 메소드

Get a unique table alias
protected _alias ( $tableName )

_fillJoinPlaceholders() 보호된 메소드

Take a query array and replace @field@ placeholders with values that will match in the load query.
protected _fillJoinPlaceholders ( Horde_Rdo_Mapper $m1, Horde_Rdo_Mapper $m2, array $query ) : array
$m1 Horde_Rdo_Mapper Left-hand mapper
$m2 Horde_Rdo_Mapper Right-hand mapper
$query array The query to process placeholders on.
리턴 array The query with placeholders filled in.

_from() 보호된 메소드

protected _from ( &$sql, &$bindParams )

_join() 보호된 메소드

protected _join ( &$sql, &$bindParams )

_limit() 보호된 메소드

protected _limit ( &$sql, &$bindParams )

_orderBy() 보호된 메소드

protected _orderBy ( &$sql, &$bindParams )

_prefix() 보호된 메소드

Callback for array_walk to prefix all elements of an array with a given prefix.
protected _prefix ( &$fieldName, $key, $prefix )

_select() 보호된 메소드

protected _select ( &$sql, &$bindParams )

_where() 보호된 메소드

protected _where ( &$sql, &$bindParams )

addFields() 공개 메소드

Adds fields to return with the query.
public addFields ( array $fields, string $fieldPrefix = null ) : Horde_Rdo_Query
$fields array Additional fields to load with this query.
$fieldPrefix string Prefix all field names with this string.
리턴 Horde_Rdo_Query Returns self for fluent method chaining.

addRelationship() 공개 메소드

Adds a relationship type to a query.
public addRelationship ( string $relationship, array $args ) : Horde_Rdo_Query
$relationship string The name of the relationship as defined in the mapper.
$args array The parameter array as defined in the mapper: - mapper: The mapper object of the result class. - table: Optional name of the table to use. - tableAlias: Optional alias name for the base table. - join_type: Optional explicitly control the type of join. - type: The type of relation, any of the constants in Horde_Rdo.
리턴 Horde_Rdo_Query This object.

addTest() 공개 메소드

public addTest ( $field, $test, $value )

clearSort() 공개 메소드

public clearSort ( )

combineWith() 공개 메소드

public combineWith ( string $conjunction )
$conjunction string SQL conjunction such as "AND", "OR".

create() 공개 정적인 메소드

Turn any of the acceptable query shorthands into a full Horde_Rdo_Query object. If you pass an existing Horde_Rdo_Query object in, it will be cloned before it's returned so that it can be safely modified.
public static create ( mixed $query, Horde_Rdo_Mapper $mapper = null ) : Horde_Rdo_Query
$query mixed The query to convert to an object.
$mapper Horde_Rdo_Mapper The Mapper object governing this query.
리턴 Horde_Rdo_Query The full Horde_Rdo_Query object.

distinct() 공개 메소드

Makes the query return only distinct (different) values.
public distinct ( boolean $distinct ) : Horde_Rdo_Query
$distinct boolean Whether to enable a distinct query.
리턴 Horde_Rdo_Query Returns self for fluent method chaining.

getQuery() 공개 메소드

Query generator.
public getQuery ( ) : array
리턴 array A two-element array of the SQL query and an array of bind parameters.

limit() 공개 메소드

Restrict the query to a subset of the results.
public limit ( integer $limit, integer $offset = null )
$limit integer Number of items to fetch.
$offset integer Offset to start fetching at.

setFields() 공개 메소드

Sets the fields to return with the query.
public setFields ( array $fields, string $fieldPrefix = null ) : Horde_Rdo_Query
$fields array The fields to load with this query.
$fieldPrefix string Prefix all field names with this string.
리턴 Horde_Rdo_Query Returns self for fluent method chaining.

setMapper() 공개 메소드

public setMapper ( Horde_Rdo_Mapper $mapper ) : Horde_Rdo_Query
$mapper Horde_Rdo_Mapper Rdo mapper base class
리턴 Horde_Rdo_Query Return the query object for fluent chaining.

sortBy() 공개 메소드

Add a sorting rule.
public sortBy ( string $sort )
$sort string SQL sort fragment, such as 'updated DESC'

프로퍼티 상세

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

protected int $_aliasCount
리턴 integer

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

protected array $_aliases
리턴 array

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

protected array $_sortby
리턴 array

$conjunction 공개적으로 프로퍼티

public string $conjunction
리턴 string

$distinct 공개적으로 프로퍼티

public bool $distinct
리턴 boolean

$fields 공개적으로 프로퍼티

public array $fields
리턴 array

$limit 공개적으로 프로퍼티

public int $limit
리턴 integer

$limitOffset 공개적으로 프로퍼티

public int $limitOffset
리턴 integer

$mapper 공개적으로 프로퍼티

public Horde_Rdo_Mapper $mapper
리턴 Horde_Rdo_Mapper

$relationships 공개적으로 프로퍼티

public array $relationships
리턴 array

$tests 공개적으로 프로퍼티

public array $tests
리턴 array