5 * Contains the entity_views_handler_field_text class.
9 * A handler to display text data.
11 * Overrides the default Views handler to retrieve the data from an entity via
14 * This handler may only be used in conjunction with data selection based Views
15 * tables or other base tables using a query plugin that supports data
18 * @see entity_views_field_definition()
19 * @ingroup views_field_handlers
21 class entity_views_handler_field_text extends views_handler_field {
24 * Stores the entity type of the result entities.
29 * Stores the result entities' metadata wrappers.
31 public $wrappers = array();
34 * Stores the current value when rendering list fields.
36 public $current_value;
39 * Overridden to add the field for the entity ID (if necessary).
41 public function query() {
42 EntityFieldHandlerHelper::query($this);
46 * Adds a click-sort to the query.
48 public function click_sort($order) {
49 EntityFieldHandlerHelper::click_sort($this, $order);
53 * Load the entities for all rows that are about to be displayed.
55 public function pre_render(&$values) {
56 parent::pre_render($values);
57 EntityFieldHandlerHelper::pre_render($this, $values);
61 * Overridden to use a metadata wrapper.
63 public function get_value($values, $field = NULL) {
64 return EntityFieldHandlerHelper::get_value($this, $values, $field);
68 * Provide options for this handler.
70 public function option_definition() {
71 return parent::option_definition() + EntityFieldHandlerHelper::option_definition($this);
75 * Provide a options form for this handler.
77 public function options_form(&$form, &$form_state) {
78 parent::options_form($form, $form_state);
79 EntityFieldHandlerHelper::options_form($this, $form, $form_state);
86 * The values retrieved from the database.
88 public function render($values) {
89 return EntityFieldHandlerHelper::render($this, $values);
93 * Render a single field value.
95 public function render_single_value($value, $values) {
96 // Sanitization is handled by the wrapper, see
97 // EntityFieldHandlerHelper::get_value().