function ArgumentValidatorTest::validateArgument
Same name in other branches
- 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_validator/ArgumentValidatorTest.php \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest::validateArgument()
- 8.9.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_validator/ArgumentValidatorTest.php \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest::validateArgument()
- 10 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_validator/ArgumentValidatorTest.php \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest::validateArgument()
Overrides ArgumentValidatorPluginBase::validateArgument
File
-
core/
modules/ views/ tests/ modules/ views_test_data/ src/ Plugin/ views/ argument_validator/ ArgumentValidatorTest.php, line 40
Class
- ArgumentValidatorTest
- Defines an argument validator test plugin.
Namespace
Drupal\views_test_data\Plugin\views\argument_validatorCode
public function validateArgument($arg) {
if ($arg === 'this value should be replaced') {
// Set the argument to a numeric value so this is valid on PostgreSQL for
// numeric fields.
$this->argument->argument = '1';
return TRUE;
}
return $arg == $this->options['test_value'];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.