function views_handler_field_entity::get_value

Return the entity object or a certain property of the entity.

Overrides views_handler_field::get_value

10 calls to views_handler_field_entity::get_value()
views_handler_field_comment_link::render in modules/comment/views_handler_field_comment_link.inc
Render the field.
views_handler_field_comment_link::render_link in modules/comment/views_handler_field_comment_link.inc
views_handler_field_comment_link_approve::render_link in modules/comment/views_handler_field_comment_link_approve.inc
views_handler_field_comment_link_delete::render_link in modules/comment/views_handler_field_comment_link_delete.inc
views_handler_field_comment_link_edit::render_link in modules/comment/views_handler_field_comment_link_edit.inc

... See full list

File

handlers/views_handler_field_entity.inc, line 91

Class

views_handler_field_entity
A handler to display data from entity objects.

Code

public function get_value($values, $field = NULL) {
    if (isset($this->entities[$this->view->row_index])) {
        $entity = $this->entities[$this->view->row_index];
        // Support to get a certain part of the entity.
        if (isset($field) && isset($entity->{$field})) {
            return $entity->{$field};
        }
        elseif (isset($field) && isset($values->{$this->aliases[$field]})) {
            return $values->{$this->aliases[$field]};
        }
        else {
            return $entity;
        }
    }
    return FALSE;
}