ZenMagick 0.9.6


org.zenmagick.rp.resultlist.ZMResultListFilter

Class ZMResultListFilter

ZMObject
|
+--ZMResultListFilter

public class ZMResultListFilter
extends ZMObject

Base result list filter.

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

Field Summary
protected mixed

$filterValues_

protected mixed

$id_

protected mixed

$list_

protected mixed

$name_

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMResultListFilter(string id, string name)

Create a new result list filter.

Method Summary
boolean

exclude(mixed obj)

Return true if the given object is to be excluded.

array

filter(array list)

Filter the given list using the filters exclude($obj) method.

string

getId()

Returns the filters unique form field name.

string

getName()

Returns the filter name.

array

getOptions()

Returns a list of all available filter values.

array

getSelectedValues()

Returns a list of active filter values.

boolean

isActive()

Returns true if this filter is currently active.

boolean

isAvailable()

Returns true if this filter is avaialble for usage.

boolean

isMultiSelection()

Returns true if this filter supports multiple values as filter value.

void

setResultList(ZMResultList list)

Set the result list we belong to.

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

Field Detail

filterValues_

protected mixed $filterValues_

id_

protected mixed $id_

list_

protected mixed $list_

name_

protected mixed $name_

Constructor Detail

ZMResultListFilter

public ZMResultListFilter(string id, string name)

Create a new result list filter.

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

Method Detail

exclude

public boolean exclude(mixed obj)

Return true if the given object is to be excluded.

Parameters:
obj - The obecjt to examine.
Returns:
true if the object is to be excluded, false if not.

filter

public array filter(array list)

Filter the given list using the filters exclude($obj) method.

Parameters:
list - The list to filter.
Returns:
The filtered list.

getId

public string getId()

Returns the filters unique form field name.

Returns:
The filters unique form field name.

getName

public string getName()

Returns the filter name.

Returns:
The filter name.

getOptions

public array getOptions()

Returns a list of all available filter values.

Returns:
An array of string values.

getSelectedValues

public array getSelectedValues()

Returns a list of active filter values.

If isActive() returns false, this list is guranteed to be empty.

Returns:
An array of string values.

isActive

public boolean isActive()

Returns true if this filter is currently active.

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

isAvailable

public boolean isAvailable()

Returns true if this filter is avaialble for usage.

Filter might be configured but not be useful if there is for example only one category or manufacturer to choose from.

Returns:
true if available, false if not.

isMultiSelection

public boolean isMultiSelection()

Returns true if this filter supports multiple values as filter value.

Returns:
true if multiple filter values are supported, false if not.

setResultList

public void setResultList(ZMResultList list)

Set the result list we belong to.

This is important to be able to analyze the list to generate the list of all available options (if based on the current data).

Parameters:
list - The current result list.

ZenMagick 0.9.6