Overview

Packages

  • Rdo

Classes

  • Horde_Rdo
  • Horde_Rdo_Base
  • Horde_Rdo_Exception
  • Horde_Rdo_Iterator
  • Horde_Rdo_List
  • Horde_Rdo_Mapper
  • Horde_Rdo_Query
  • Horde_Rdo_Query_Literal
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Rdo_Query

Package: Rdo
Category: Horde
Located at Horde/Rdo/Query.php
Methods summary
public static Horde_Rdo_Query
# create( mixed $query, Horde_Rdo_Mapper $mapper = null )

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.

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.

Parameters

$query
The query to convert to an object.
$mapper
The Mapper object governing this query.

Returns

Horde_Rdo_Query
The full Horde_Rdo_Query object.
public
# __construct( Horde_Rdo_Mapper $mapper = null )

Parameters

$mapper
Rdo mapper base class
public Horde_Rdo_Query
# setMapper( Horde_Rdo_Mapper $mapper )

Parameters

$mapper
Rdo mapper base class

Returns

Horde_Rdo_Query
Return the query object for fluent chaining.
public Horde_Rdo_Query
# distinct( boolean $distinct )

Makes the query return only distinct (different) values.

Makes the query return only distinct (different) values.

Parameters

$distinct
Whether to enable a distinct query.

Returns

Horde_Rdo_Query
Returns self for fluent method chaining.

Since

Horde_Rdo 1.1.0
public Horde_Rdo_Query
# setFields( array $fields, mixed $fieldPrefix = null )

Parameters

$fields
The fields to load with this query.
$fieldPrefix

Returns

Horde_Rdo_Query
Returns self for fluent method chaining.
public Horde_Rdo_Query
# addFields( array $fields, mixed $fieldPrefix = null )

Parameters

$fields
Additional Fields to load with this query.
$fieldPrefix

Returns

Horde_Rdo_Query
Returns self for fluent method chaining.
public
# combineWith( string $conjunction )

Parameters

$conjunction
SQL conjunction such as "AND", "OR".
public
# addTest( mixed $field, mixed $test, mixed $value )
public
# addRelationship( mixed $relationship, mixed $args )
public
# sortBy( string $sort )

Add a sorting rule.

Add a sorting rule.

Parameters

$sort
SQL sort fragment, such as 'updated DESC'
public
# clearSort( )
public
# limit( integer $limit, integer $offset = null )

Restrict the query to a subset of the results.

Restrict the query to a subset of the results.

Parameters

$limit
Number of items to fetch.
$offset
Offset to start fetching at.
public
# __get( string $key )

Accessor for any fields that we want some logic around.

Accessor for any fields that we want some logic around.

Parameters

$key
public array
# getQuery( )

Query generator.

Query generator.

Returns

array

A two-element array of the SQL query and an array of bind parameters.

Properties summary
public Horde_Rdo_Mapper $mapper
#
public string $conjunction
# 'AND'
public array $fields
# array('*')
public boolean $distinct
# false
public array $tests
# array()
public array $relationships
# array()
public integer $limit
#
public integer $limitOffset
# null
API documentation generated by ApiGen