DblogTypes.php

Same filename in other branches
  1. 8.9.x core/modules/dblog/src/Plugin/views/filter/DblogTypes.php
  2. 10 core/modules/dblog/src/Plugin/views/filter/DblogTypes.php
  3. 11.x core/modules/dblog/src/Plugin/views/filter/DblogTypes.php

Namespace

Drupal\dblog\Plugin\views\filter

File

core/modules/dblog/src/Plugin/views/filter/DblogTypes.php

View source
<?php

namespace Drupal\dblog\Plugin\views\filter;

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

/**
 * Exposes log types to views module.
 *
 * @ViewsFilter("dblog_types")
 */
class DblogTypes extends InOperator {
    
    /**
     * {@inheritdoc}
     */
    public function getValueOptions() {
        if (!isset($this->valueOptions)) {
            $this->valueOptions = _dblog_get_message_types();
        }
        return $this->valueOptions;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function valueForm(&$form, FormStateInterface $form_state) {
        parent::valueForm($form, $form_state);
        $form['value']['#access'] = !empty($form['value']['#options']);
    }

}

Classes

Title Deprecated Summary
DblogTypes Exposes log types to views module.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.