function entity_translation_handler_field_label::post_execute in Entity Translation 7
Load all entities, so that we can get the label.
Overrides views_handler::post_execute
File
- views/
entity_translation_handler_field_label.inc, line 47 - This file contains a label field handler for entity translation.
Class
- entity_translation_handler_field_label
- This handler shows the entity label for entities in the entity_translation table.
Code
function post_execute(&$values) {
$ids = array();
$ids_by_type = array();
foreach ($values as $row) {
if ($entity_type = $this
->get_value($row, 'entity_type')) {
$ids_by_type[$entity_type][] = $this
->get_value($row, 'entity_id');
}
}
foreach ($ids_by_type as $type => $ids) {
$this->entities[$type] = entity_load($type, $ids);
}
}