ZenMagick 0.9.8


org.zenmagick.mvc.resultlist.ZMResultListSorter
\mvc\resultlist\ZMResultListSorter.php at line 33

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 2610 2009-11-20 02:45:25Z dermanomann $

Field Summary
protected mixed

$descending_

protected mixed

$id_

protected mixed

$name_

protected mixed

$sortId_

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMResultListSorter(string id, string name, string sortId)

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.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

\mvc\resultlist\ZMResultListSorter.php at line 37

descending_

protected mixed $descending_

\mvc\resultlist\ZMResultListSorter.php at line 34

id_

protected mixed $id_

\mvc\resultlist\ZMResultListSorter.php at line 35

name_

protected mixed $name_

\mvc\resultlist\ZMResultListSorter.php at line 36

sortId_

protected mixed $sortId_

Constructor Detail

\mvc\resultlist\ZMResultListSorter.php at line 47

ZMResultListSorter

public ZMResultListSorter(string id, string name, string sortId)

Create a new result list sorter.

Parameters:
id - Optional sorter id.
name - Optional sorter name.
sortId - Optional sort id.

Method Detail

\mvc\resultlist\ZMResultListSorter.php at line 102

getId

public string getId()

Returns the sorters unique id.

Returns:
The sorter id.

\mvc\resultlist\ZMResultListSorter.php at line 109

getName

public string getName()

Returns the sorter name.

Returns:
The sorter name.

\mvc\resultlist\ZMResultListSorter.php at line 78

getOptions

public array getOptions()

Returns one or more ZMSortOptions supported by this sorter.

Returns:
An array of one or more ZMSortOption instances.

\mvc\resultlist\ZMResultListSorter.php at line 130

getSortId

public string getSortId()

Returns the sorters sort id.

Returns:
The sortid.

\mvc\resultlist\ZMResultListSorter.php at line 95

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.

\mvc\resultlist\ZMResultListSorter.php at line 71

isDescending

public boolean isDescending()

Returns true if the current sort order is descending.

Returns:
true if the current sort order is descending.

\mvc\resultlist\ZMResultListSorter.php at line 144

setDescending

public void setDescending(boolean descending)

Set the descending flag.

Parameters:
descending - The new value.

\mvc\resultlist\ZMResultListSorter.php at line 116

setId

public void setId(string id)

Set the sorters unique id.

Parameters:
id - The sorter id.

\mvc\resultlist\ZMResultListSorter.php at line 123

setName

public void setName(string name)

Set the sorter name.

Parameters:
name - The sorter name.

\mvc\resultlist\ZMResultListSorter.php at line 137

setSortId

public void setSortId(mixed sortId, string id)

Set the sorters sorter id.

Parameters:
id - The sort id.

\mvc\resultlist\ZMResultListSorter.php at line 86

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.8