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
AfsQueryCoder Class Reference

Default query coder implementation. More...

Inheritance diagram for AfsQueryCoder:
AfsQueryCoderInterface

Public Member Functions

 __construct ($path=null, AfsCoderInterface $feed_coder=null, AfsCoderInterface $filter_coder=null, AfsCoderInterface $sort_coder=null)
 Construct new instance.
 generate_parameters (AfsQuery $query)
 Generate URL parameters from AfsQuery.
 generate_link (AfsQuery $query)
 Convenient method to build link.
 build_query (array $params)
 Generate query from URL parameters.

Detailed Description

Default query coder implementation.

Examples:
full_example.php.

Constructor & Destructor Documentation

__construct (   $path = null,
AfsCoderInterface  $feed_coder = null,
AfsCoderInterface  $filter_coder = null,
AfsCoderInterface  $sort_coder = null 
)

Construct new instance.

Parameters
$path[in] base path used to generate appropriate link (see generate_link method). If this parameter is not provided, value of $_SERVER['PHP_SELF'] is used as default value.
$feed_coder[in] (optional) feed coder. If not set, default implementation is used (see AfsFeedCoder).
$filter_coder[in] (optional) filter coder. If not set, default implementation is used (see AfsFilterCoder).
$sort_coder[in] (optional) sort parameters coder. If not set, default implementation is used (see AfsSortCoder).

Member Function Documentation

build_query ( array  $params)

Generate query from URL parameters.

Parameters
$params[in] array of parameters. Usually set to $_GET.
Returns
AfsQuery correctly initialized.

Implements AfsQueryCoderInterface.

generate_link ( AfsQuery  $query)

Convenient method to build link.

Combine path parameter to result of generate_parameters call.

Parameters
$query[in] AfsQuery used to generate appropriate link.
Returns
link which can be directly used to query AFS search engine.

Implements AfsQueryCoderInterface.

generate_parameters ( AfsQuery  $query)

Generate URL parameters from AfsQuery.

Parameters
$query[in] query to transform to URL parameters.
Returns
appropriate URL parameters representing input query.

Implements AfsQueryCoderInterface.