SorterDefaultAdapter Class Reference
[Controller]
Default Implementation of Sorter adapter. More...
Public Member Functions |
|
__construct (PageData $page_data, $param_column= 'sc', $param_order= 'so') | |
get_column () | |
Return column key of column to sort after.
|
|
get_order () | |
Returns sort order ('forward' or
'backward'). |
|
get_url_for_sort ($column, $order) | |
Return link to invoke sorting on given
column with given order. |
|
Static Public Member Functions |
|
static | apply_to_url ($url, $column, $order, $param_column= 'sc', $param_order= 'so') |
Prepare URL so filter gets applied. |
|
Protected Attributes |
|
$page_data | |
$param_column | |
$param_order |
Detailed Description
Default Implementation of Sorter adapter.
Uses GET-Parameters as sorter parameters
Definition at line 177 of file sorter.cls.php.
Constructor & Destructor Documentation
SorterDefaultAdapter::__construct | ( | PageData $ | page_data, | |
$ | param_column =
'sc' , |
|||
$ | param_order = 'so' |
|||
) |
Definition at line 182 of file sorter.cls.php.
00182 { 00183 $this->page_data = $page_data; 00184 $this->param_column = $param_column; 00185 $this->param_order = $param_order; 00186 }
Member Function Documentation
static SorterDefaultAdapter::apply_to_url | ( | $ | url, | |
$ | column, | |||
$ | order, | |||
$ | param_column =
'sc' , |
|||
$ | param_order = 'so' |
|||
) | [static] |
Prepare URL so filter gets applied.
- Returns:
- void
Definition at line 229 of file sorter.cls.php.
00229 { 00230 $url->replace_query_parameter($param_order, $order)->replace_query_parameter($param_column, $column); 00231 }
SorterDefaultAdapter::get_column | ( | ) |
Return column key of column to sort after.
- Returns:
- string
Implements ISorterAdapter.
Definition at line 193 of file sorter.cls.php.
SorterDefaultAdapter::get_order | ( | ) |
Returns sort order ('forward' or 'backward').
False if no order was set
- Returns:
- string
Implements ISorterAdapter.
Definition at line 204 of file sorter.cls.php.
SorterDefaultAdapter::get_url_for_sort | ( | $ | column, | |
$ | order | |||
) |
Return link to invoke sorting on given column with given order.
- Parameters:
-
string $column string $order
- Returns:
- Url
Implements ISorterAdapter.
Definition at line 215 of file sorter.cls.php.
00215 { 00216 $url = Url::current(); 00217 self::apply_to_url($url, $column, $order, $this->param_column, $this->param_order); 00218 return $url; 00219 }
Member Data Documentation
SorterDefaultAdapter::$page_data
[protected] |
Definition at line 178 of file sorter.cls.php.
SorterDefaultAdapter::$param_column
[protected] |
Definition at line 179 of file sorter.cls.php.
SorterDefaultAdapter::$param_order
[protected] |
Definition at line 180 of file sorter.cls.php.
The documentation for this class was generated from the following file:
- gyro/core/controller/tools/sorter.cls.php