function _views_navigation_get_entity_type in Views navigation 7
Function to get the entity type.
Parameters
object $query: The query object.
Return value
string The entity type.
6 calls to _views_navigation_get_entity_type()
- views_navigation_get_result in ./
views_navigation.inc - Get the result of a query, as an array of etids keyed by position.
- views_navigation_handler_field_node::render_link in views/
views_navigation_handler_field_node.inc - Implements render_link().
- _views_navigation_build_query in ./
views_navigation.inc - Add the query parameters to append to the entity url.
- _views_navigation_build_url in ./
views_navigation.inc - Used when the view handler needs an already built url.
- _views_navigation_get_data in ./
views_navigation.inc - Helper function to get the data.
File
- ./
views_navigation.inc, line 484 - Views navigation main include file.
Code
function _views_navigation_get_entity_type($query) {
// TODO Have it work with search API.
$entity_type = $query->base_table;
if ($entity_type == 'taxonomy_term_data') {
$entity_type = 'taxonomy_term';
}
if (get_class($query) == 'SearchApiViewsQuery') {
$entity_type = $query
->getIndex()
->getEntityType();
}
return $entity_type;
}