Configuration class for AFS facets.
More...
Detailed Description
Configuration class for AFS facets.
- Examples:
- full_example.php.
Constructor & Destructor Documentation
Construct new facet with specified parameters.
- Parameters
-
$id | [in] facet id defined in feed.xml on indexation side. |
$type | [in] facet type defined in feed.xml on indexation side. Default value is AfsFacetType::UNKNOWN_TYPE. (see AfsFacetType for available types). |
$layout | [in] facet layout defined in feed.xml on indexation side. Default value is AfsFacetLayout::TREE. (see AfsFacetLayout for availanle layouts). |
$mode | [in] facet mode, see AfsFacetMode for more details. (default: UNSPECIFIED_MODE). |
- Exceptions
-
InvalidArgumentException | invalid parameter value provided for id, type, layout or mode parameter. |
Member Function Documentation
Printable facet.
This method should be used for debug purpose only.
- Returns
- string representation of the facet.
Retrieves facet id.
- Returns
- facet id.
Retrieves facet layout.
- Returns
- layout of the facet.
Retrieve facet mode.
- Returns
- facet mode (
replace
, or
, add
or unspecified
).
Retrieves facet type.
- Returns
- type of the facet.
get_values_sort_order |
( |
| ) |
|
Check whether mode is set to or
.
- Returns
- true when mode is
or
, false otherwise.
Check whether mode is set to or
.
- Returns
- true when mode is
or
, false otherwise.
Check whether mode is set to single
.
- Returns
- true when mode is
single
, false otherwise.
Checks whether provided facet is similar to current instance.
Two instances are considered similar when following values are equals:
- facet identifier,
- facet type (or one is of unknown type),
- facet layout (or one is of unknown layout). Other facet parameters are not taken into account.
- Parameters
-
$other | [in] instance to compare with. |
- Returns
True
when both instances are similar, false
otherwise.
Defines new facet mode.
- Parameters
-
$mode | [in] New mode to set. |
- Exceptions
-
InvalidArgumentException | invalid mode provided. |
Redefines facet type.
- Parameters
-
$type | [in] new type of the facet to set. |
- Exceptions
-
InvalidArgumentException | invalid type provided. |
set_values_sort_order |
( |
|
$mode, |
|
|
|
$sort |
|
) |
| |
set values sort order for this facet
AFS search default sort for facet values is alphanumeric. This method allows to change this behaviour.
- Parameters
-
Updates current instance with parameters from other instance.
First, both instance are compared then when they are enough similar current instance is updated.
This can be usefull internally when facets are partially declared.
- Parameters
-
$other | [in] other instance to compare with and use as source to update. |
- Returns
true
when everything goes right, false
otherwise (instances are not similar).