class NullArgument
Same name and namespace in other branches
- 11.x core/modules/views/src/Plugin/views/argument/NullArgument.php \Drupal\views\Plugin\views\argument\NullArgument
- 10 core/modules/views/src/Plugin/views/argument/NullArgument.php \Drupal\views\Plugin\views\argument\NullArgument
- 8.9.x core/modules/views/src/Plugin/views/argument/NullArgument.php \Drupal\views\Plugin\views\argument\NullArgument
Argument handler that ignores the argument.
Plugin annotation
@ViewsArgument("null");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\views\Plugin\views\PluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\views\Plugin\views\HandlerBase implements \Drupal\views\Plugin\views\ViewsHandlerInterface extends \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\argument\ArgumentPluginBase implements \Drupal\Core\Cache\CacheableDependencyInterface extends \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\argument\NullArgument extends \Drupal\views\Plugin\views\argument\ArgumentPluginBase
- class \Drupal\views\Plugin\views\argument\ArgumentPluginBase implements \Drupal\Core\Cache\CacheableDependencyInterface extends \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\HandlerBase implements \Drupal\views\Plugin\views\ViewsHandlerInterface extends \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of NullArgument
Related topics
File
-
core/
modules/ views/ src/ Plugin/ views/ argument/ NullArgument.php, line 14
Namespace
Drupal\views\Plugin\views\argumentView source
class NullArgument extends ArgumentPluginBase {
protected function defineOptions() {
$options = parent::defineOptions();
$options['must_not_be'] = [
'default' => FALSE,
];
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['must_not_be'] = [
'#type' => 'checkbox',
'#title' => $this->t('Fail basic validation if any argument is given'),
'#default_value' => !empty($this->options['must_not_be']),
'#description' => $this->t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'),
'#group' => 'options][more',
];
unset($form['exception']);
}
/**
* {@inheritdoc}
*/
protected function defaultActions($which = NULL) {
if ($which) {
if (in_array($which, [
'ignore',
'not found',
'empty',
'default',
])) {
return parent::defaultActions($which);
}
return;
}
$actions = parent::defaultActions();
unset($actions['summary asc']);
unset($actions['summary desc']);
return $actions;
}
/**
* {@inheritdoc}
*/
public function query($group_by = FALSE) {
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.