SearchRow.php

Definition of Drupal\search\Plugin\views\row\SearchRow.

Namespace

Drupal\search\Plugin\views\row

File

drupal/core/modules/search/lib/Drupal/search/Plugin/views/row/SearchRow.php
View source
<?php

/**
 * @file
 * Definition of Drupal\search\Plugin\views\row\SearchRow.
 */
namespace Drupal\search\Plugin\views\row;

use Drupal\views\Plugin\views\row\RowPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;

/**
 * Plugin which performs a node_view on the resulting object.
 *
 * @Plugin(
 *   id = "search_view",
 *   module = "search",
 *   title = @Translation("Search"),
 *   no_uid = TRUE
 * )
 */
class SearchRow extends RowPluginBase {
  protected function defineOptions() {
    $options = parent::defineOptions();
    $options['score'] = array(
      'default' => TRUE,
      'bool' => TRUE,
    );
    return $options;
  }
  public function buildOptionsForm(&$form, &$form_state) {
    $form['score'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display score'),
      '#default_value' => $this->options['score'],
    );
  }

  /**
   * Override the behavior of the render() function.
   */
  function render($row) {
    return array(
      '#theme' => $this
        ->themeFunctions(),
      '#view' => $this->view,
      '#options' => $this->options,
      '#row' => $row,
    );
  }

}

Classes

Namesort descending Description
SearchRow Plugin which performs a node_view on the resulting object.