ZenMagick 0.9.10


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

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

Field Summary
protected mixed

$descending_

protected mixed

$id_

protected mixed

$name_

protected mixed

$sortId_

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct(string id, string name, string sortId)

Create a new result list sorter.

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
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Field Detail

mvc\resultlist\ZMResultListSorter.php at line 36

descending_

protected mixed $descending_

mvc\resultlist\ZMResultListSorter.php at line 33

id_

protected mixed $id_ = ''

mvc\resultlist\ZMResultListSorter.php at line 34

name_

protected mixed $name_

mvc\resultlist\ZMResultListSorter.php at line 35

sortId_

protected mixed $sortId_

Method Detail

mvc\resultlist\ZMResultListSorter.php at line 46

__construct

public void __construct(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.

mvc\resultlist\ZMResultListSorter.php at line 101

getId

public string getId()

Returns the sorters unique id.

Returns:
The sorter id.

mvc\resultlist\ZMResultListSorter.php at line 108

getName

public string getName()

Returns the sorter name.

Returns:
The sorter name.

mvc\resultlist\ZMResultListSorter.php at line 77

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 129

getSortId

public string getSortId()

Returns the sorters sort id.

Returns:
The sortid.

mvc\resultlist\ZMResultListSorter.php at line 94

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 70

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 143

setDescending

public void setDescending(boolean descending)

Set the descending flag.

Parameters:
descending - The new value.

mvc\resultlist\ZMResultListSorter.php at line 115

setId

public void setId(string id)

Set the sorters unique id.

Parameters:
id - The sorter id.

mvc\resultlist\ZMResultListSorter.php at line 122

setName

public void setName(string name)

Set the sorter name.

Parameters:
name - The sorter name.

mvc\resultlist\ZMResultListSorter.php at line 136

setSortId

public void setSortId(mixed sortId, string id)

Set the sorters sorter id.

Parameters:
id - The sort id.

mvc\resultlist\ZMResultListSorter.php at line 85

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