PHP Класс Horde_Rdo_Query, horde

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$conjunction string
$distinct boolean
$fields array
$limit integer
$limitOffset integer
$mapper Horde_Rdo_Mapper
$relationships array
$tests array

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

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