You are here

ViewsJsonParameter.php in Views Json Source 8

Same filename and directory in other branches
  1. 1.x src/Plugin/views/argument/ViewsJsonParameter.php

File

src/Plugin/views/argument/ViewsJsonParameter.php
View source
<?php

namespace Drupal\views_json_source\Plugin\views\argument;

use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Base argument handler for views_json_source.
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("views_json_source_parameter")
 */
class ViewsJsonParameter extends ArgumentPluginBase {

  /**
   * Add this filter to the query.
   */
  public function query($group_by = FALSE) {
    $this->query
      ->addContextualFilter($this->argument);
  }

  /**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    $form['markup'] = [
      '#markup' => $this
        ->t('Add this field to pick the dynamic node from the response.'),
    ];
  }

}

Classes

Namesort descending Description
ViewsJsonParameter Base argument handler for views_json_source.