generate_ccl()
Description
string generate_ccl (array array)
Generates a valid CCL query from the passed array. The idea of this function is to centralize the way Emilda processes CCL queries, so that it is easy to alter this logics.
generate_ccl() accepts an arbitrary key-value pair array, where it only processes the key-value pairs where the key is a valid MARC field. By valid we mean a field defined in the MARC-configuration section, not that it is according to some MARC standard. If there is more than one valid key-value pair, these are appended to each other with the logical "AND"-operator.
As such, if You have a form with fields which You want to search from, You only have to give $_REQUEST as the argument to generate valid and working CCL, assuming that the fields are named e.g. 020 for ISBN, or 100 for author.
Examples
Example of an array that will generate the example query.
Array (
"100" => "Jansson",
"245" => "Mumin",
)
Will generate the following query (with the example CCL-names from emilda)
author=Jansson and title=Mumin

