.

DBQueryOrdered Class Reference
[Model]

An ordered query. More...

Inheritance diagram for DBQueryOrdered:
DBQueryLimited DBQuery IDBQuery IDBSqlBuilder IPolicyHolder IDBWhereHolder DBQueryDelete DBQuerySelect DBQueryUpdate DBQueryCount DBQueryJoined

List of all members.

Public Member Functions

  add_order ($column, $direction=self::ASC)
  Add order.
  get_orders ()
  Returns orders.

Public Attributes

const  ASC = 'ASC'
const  DESC = 'DESC'

Protected Attributes

  $orders = array()

Detailed Description

An ordered query.

Author:
Gerd Riesselmann

Definition at line 10 of file dbquery.ordered.cls.php.


Member Function Documentation

DBQueryOrdered::add_order ( column,
direction = self::ASC  
)

Add order.

Use DBQueryOrdered::CLEAR as column to clear all orders

Parameters:
string  $column
string  $direction Either DBQueryOrdered::ASC or DBQueryOrdered::DESC

Definition at line 27 of file dbquery.ordered.cls.php.

00027                                                                  {
00028                 if (empty($column)) {
00029                         $this->orders = array();
00030                 } else {
00031                         $table = $this->table;
00032                         $this->orders[] = array(
00033                                 'field' => $column,
00034                                 'table' => $table,
00035                                 'direction' => $direction
00036                         );
00037                 }               
00038         }
DBQueryOrdered::get_orders (  ) 

Returns orders.

Returns:
array Array of associative arrays of form "Field => Direction"

Definition at line 45 of file dbquery.ordered.cls.php.

00045                                      {
00046                 return $this->orders;
00047         }

Member Data Documentation

DBQueryOrdered::$orders = array() [protected]

Definition at line 19 of file dbquery.ordered.cls.php.

Definition at line 11 of file dbquery.ordered.cls.php.

Definition at line 12 of file dbquery.ordered.cls.php.


The documentation for this class was generated from the following file: