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 | List of all members
AfsFacetHelper Class Reference

Helper to manage facets. More...

Inheritance diagram for AfsFacetHelper:
AfsHelperBase

Public Member Functions

 __construct ($facet, AfsQuery $query, AfsHelperConfiguration $config, $feed=null)
 Constructs new instance of facet helper.
 get_label ()
 Retrieve facet label.
 get_id ()
 Retrieves facet id.
 get_layout ()
 Retrieves facet layout.
 get_type ()
 Retrieves facet type.
 is_sticky ()
 Retrieves stickyness of the facet.
 get_elements ()
 Retrieve all facet elements of this facet.
 format ()
 Retrieve facet as array.
- Public Member Functions inherited from AfsHelperBase
 __get ($name)
 Simple property helper.

Detailed Description

Helper to manage facets.

Constructor & Destructor Documentation

__construct (   $facet,
AfsQuery  $query,
AfsHelperConfiguration  $config,
  $feed = null 
)

Constructs new instance of facet helper.

Parameters
$facet[in] root facet element.
$query[in] AfsQuery which has produced current reply.
$config[in] helper configuration object.

Member Function Documentation

format ( )

Retrieve facet as array.

All data are store in key => value format:

Returns
array filled with key and values.
get_elements ( )

Retrieve all facet elements of this facet.

Returns
facet elements.
get_id ( )

Retrieves facet id.

This value is not necessary unless specific query should be created instead of the ones provided by AfsFacetValueHelper.

Returns
the id of the facet.
get_label ( )

Retrieve facet label.

First label found is retrieved. Label in right language is retrieved as soon as filter on required language has been set in AfsQuery.

Returns
facet label.
get_layout ( )

Retrieves facet layout.

Returns
layout of the facet (should be AFS_FACET_INTERVAL or AFS_FACET_TREE).
get_type ( )

Retrieves facet type.

Returns
type of the facet (should be one of AFS_FACET_INTEGER, AFS_FACET_REAL...)
is_sticky ( )

Retrieves stickyness of the facet.

Returns
return true when the facet is sticky, false otherwise.
return true when the facet is sticky, false otherwise.