Antidot PHP API  version 0.16.0
##PHP API to simplify integration of Antidot components
 All Classes Files Functions Variables Groups Pages
Public Member Functions | Public Attributes | List of all members
AfsFacetValueHelper Class Reference

Simple AFS facet value representation. More...

Inheritance diagram for AfsFacetValueHelper:
AfsHelperBase

Public Member Functions

 __construct ($label, $key, $count, $meta, $active, $query, $link, $children)
 Construct new instance. (see class attributes for details)
 get_meta ($name=null)
 Retrieves meta data associated to the facet value.
 format ()
 Retrieve facet element as array.
- Public Member Functions inherited from AfsHelperBase
 __get ($name)
 Simple property helper.

Public Attributes

 $label = null
 Label of facet value.
 $key = null
 Key of facet value.
 $count = null
 Number of elements of facet value.
 $active = null
 Boolean state of facet value.
 $query = null
 Generated query associated to this facet value.
 $link = null
 Generated link from above query.
 $values = null
 List of child facet values.

Detailed Description

Simple AFS facet value representation.

Member Function Documentation

format ( )

Retrieve facet element as array.

All data are store in key => value format:

  • label: label of the facet value,
  • key: key of the facet value,
  • count: number of element of the facet value,
  • active: state of the facet value: true when this facet value is used in current query, false otherwise,
  • query: query associated to the facet value (see query property for more details),
  • link: link generated from the query,
  • values: list of children facet values. This list is not empty for tree facets only.
  • meta: key-value pairs of meta data identifiers and values.
Remarks
: When helpers are used to create such facet value, if link is generated from query, then the query is no more necessary and not provided. So one of query and link is null.
Returns
array filled with key and values.
get_meta (   $name = null)

Retrieves meta data associated to the facet value.

Parameters
$name[in] Name of the metadata to retrieve. Default is null which means retrieves all meta data as array of values (keys correspond to meta data name, values correspond to meta data value associated to current facet value).
Returns
required meta data or all meta data (see name).
Exceptions
OutOfBoundsExceptionwhen required meta data name does not exist.

Member Data Documentation

$active = null

Boolean state of facet value.

Set to true when current query filters on this facet value.

$query = null

Generated query associated to this facet value.

When this facet value is active, filter on this facet value is remove from query. If this facet value is inactive, filter on this facet value is added to query.

Added filter replace or complete existing filters depending on facet configuration.

$values = null

List of child facet values.

This list is usually empty except for tree facets.