function hook_sbp_query_modify in Search by Page 6
Same name and namespace in other branches
- 7 search_by_page.api.php \hook_sbp_query_modify()
Add conditions to the search query (required sub-module hook).
This hook allows a module to add conditions (usually related to access permissions) to the query that finds the search results. These will be passed into do_search(), to limit the search results.
Return value
Array with components:
- 'join': Join expression to add to the search query, using "sp.modid" as the ID column to join on (i.e. the ID your module returned in hook_sbp_paths()). All joins should be LEFT JOIN, because other modules will also have independent joins to do.
- 'where': Where clause to add to the query, for rows where the join applies.
- 'arguments': Array of arguments to be substituted in for %d, %s, etc. in the where clause.
4 functions implement hook_sbp_query_modify()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- sbp_attach_sbp_query_modify in ./
sbp_attach.module - Implementation of Search by Page hook_sbp_query_modify().
- sbp_nodes_sbp_query_modify in ./
sbp_nodes.module - Implementation of Search by Page hook_sbp_query_modify().
- sbp_paths_sbp_query_modify in ./
sbp_paths.module - Implementation of Search by Page hook_sbp_query_modify().
- sbp_users_sbp_query_modify in ./
sbp_users.module - Implementation of Search by Page hook_sbp_query_modify().
1 invocation of hook_sbp_query_modify()
- _search_by_page_do_search in ./
search_by_page.module - Internal function: performs a search, for hook_search($op = 'search').
File
- ./
search_by_page.api.php, line 158 - Search by Page module API.
Code
function hook_sbp_query_modify($environment) {
// This example gives access to every path defined by this module.
return array(
'join' => '',
'where' => 1,
'arguments' => array(),
);
}