You are here

abstract public function entity_views_example_query::get_result_entities in Entity API 7

Returns the according entity objects for the given query results.

This is compatible to the get_result_entities() method used by Views.

The method is responsible for resolving the relationship and returning the entity objects for that relationship. The helper methods EntityFieldHandlerHelper::construct_property_selector() and EntityFieldHandlerHelper::extract_property_multiple() can be used to do this.

Parameters

$results: The results of the query, as returned by this query plugin.

$relationship: (optional) A relationship for which the entities should be returned.

$field: (optional) The field for which the entity should be returned. This is only needed in case a field is derived via a referenced entity without using a relationship. For example, if the node's field "author:name" is used, the user entity would be returned instead of the node entity.

Return value

array A numerically indexed array containing two items: the entity type of entities returned by this method; and the array of entities, keyed by the same indexes as the results.

Overrides views_plugin_query::get_result_entities

See also

EntityFieldHandlerHelper::extract_property_multiple()

File

views/entity_views_example_query.php, line 66
Contains an example for a Views query plugin that could use the data selection tables.

Class

entity_views_example_query
Describes the additional methods looked for on a query plugin if data selection based tables or fields are used.

Code

public abstract function get_result_entities($results, $relationship = NULL, $field = NULL);