Editable.php in Views Node Access Filter 8
File
src/Plugin/views/filter/Editable.php
View source
<?php
namespace Drupal\views_node_access_filter\Plugin\views\filter;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\filter\FilterPluginBase;
use Drupal\views\Plugin\views\query\Sql;
class Editable extends FilterPluginBase {
public function query() {
if ($this->query instanceof Sql) {
$this
->ensureMyTable();
$this->query
->addTag('views_node_access_filter_editable');
}
else {
throw new \Exception("Editable filter is only compatible with SQL views.");
}
}
public function getCacheContexts() {
$contexts = parent::getCacheContexts();
$contexts[] = 'user';
return $contexts;
}
public function canExpose() {
return FALSE;
}
public function adminSummary() {
}
protected function operatorForm(&$form, FormStateInterface $form_state) {
}
}