3 namespace Drupal\node\Plugin\views\filter;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\views\Plugin\views\filter\FilterPluginBase;
9 * Filter by published status.
11 * @ingroup views_filter_handlers
13 * @ViewsFilter("node_status")
15 class Status extends FilterPluginBase {
17 public function adminSummary() {}
19 protected function operatorForm(&$form, FormStateInterface $form_state) {}
21 public function canExpose() {
25 public function query() {
26 $table = $this->ensureMyTable();
27 $this->query->addWhereExpression($this->options['group'], "$table.status = 1 OR ($table.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0 AND ***VIEW_OWN_UNPUBLISHED_NODES*** = 1) OR ***BYPASS_NODE_ACCESS*** = 1");
33 public function getCacheContexts() {
34 $contexts = parent::getCacheContexts();