metrc-1.0.x-dev/modules/metrc_views/src/Plugin/views/filter/Uid.php

modules/metrc_views/src/Plugin/views/filter/Uid.php
<?php

namespace Drupal\metrc_views\Plugin\views\filter;

use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\filter\FilterPluginBase;

/**
 * Simple filter to handle filtering metrc results by uid.
 *
 * @ViewsFilter("metrc_uid")
 */
class Uid extends FilterPluginBase {

  public $no_operator = TRUE;

  protected $alwaysMultiple = TRUE;

  /**
   * {@inheritdoc}
   */
  public function adminSummary() {
    $summary = parent::adminSummary();
    if (!empty($this->options['exposed'])) {
      $summary = $this->t('exposed');
    }
    return $summary;
  }

  /**
   * {@inheritdoc}
   */
  protected function valueForm(&$form, FormStateInterface $form_state) {
    $form['value'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Value'),
      '#size' => 30,
      '#default_value' => $this->value,
    ];
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc