ZenMagick 0.9.6


org.zenmagick.rp.resultlist.ZMResultListSorter

Class ZMResultListSorter

ZMObject
|
+--ZMResultListSorter

public class ZMResultListSorter
extends ZMObject

Base result list sorter.

Right now, result lists may be sorted with a single sorter only.

Author:
DerManoMann
Version:
$Id: ZMResultListSorter.php 1966 2009-02-14 10:52:50Z dermanomann $

Field Summary
protected mixed

$descending_

protected mixed

$id_

protected mixed

$name_

protected mixed

$sortId_

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMResultListSorter(string id, string name)

Create a new result list sorter.

Method Summary
string

getId()

Returns the sorters unique id.

string

getName()

Returns the sorter name.

array

getOptions()

Returns one or more ZMSortOptions supported by this sorter.

string

getSortId()

Returns the sorters sort id.

boolean

isActive()

Returns true if this sorter is currently active.

boolean

isDescending()

Returns true if the current sort order is descending.

void

setDescending(boolean descending)

Set the descending flag.

void

setId(string id)

Set the sorters unique id.

void

setName(string name)

Set the sorter name.

void

setSortId(mixed sortId, string id)

Set the sorters sorter id.

array

sort(array list)

Sort the given list according to this sorters criteria.

Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

descending_

protected mixed $descending_

id_

protected mixed $id_

name_

protected mixed $name_

sortId_

protected mixed $sortId_

Constructor Detail

ZMResultListSorter

public ZMResultListSorter(string id, string name)

Create a new result list sorter.

Parameters:
id - An optional sorter id.
name - An optional sorter name.

Method Detail

getId

public string getId()

Returns the sorters unique id.

Returns:
The sorter id.

getName

public string getName()

Returns the sorter name.

Returns:
The sorter name.

getOptions

public array getOptions()

Returns one or more ZMSortOptions supported by this sorter.

Returns:
An array of one or more ZMSortOption instances.

getSortId

public string getSortId()

Returns the sorters sort id.

Returns:
The sortid.

isActive

public boolean isActive()

Returns true if this sorter is currently active.

This translates into: one of the supported sort options is active.

Returns:
true if the sorter is active, false if not.

isDescending

public boolean isDescending()

Returns true if the current sort order is descending.

Returns:
true if the current sort order is descending.

setDescending

public void setDescending(boolean descending)

Set the descending flag.

Parameters:
descending - The new value.

setId

public void setId(string id)

Set the sorters unique id.

Parameters:
id - The sorter id.

setName

public void setName(string name)

Set the sorter name.

Parameters:
name - The sorter name.

setSortId

public void setSortId(mixed sortId, string id)

Set the sorters sorter id.

Parameters:
id - The sort id.

sort

public array sort(array list)

Sort the given list according to this sorters criteria.

Parameters:
list - The list to sort.
Returns:
The sorted list.

ZenMagick 0.9.6