public function SerbianVat::validate in Commerce Core 8.2
Validates the given tax number.
Parameters
string $tax_number: The tax number.
Return value
bool TRUE if the given tax number if valid, FALSE otherwise.
Overrides TaxNumberTypeInterface::validate
File
- modules/
tax/ tests/ modules/ commerce_tax_test/ src/ Plugin/ Commerce/ TaxNumberType/ SerbianVat.php, line 25
Class
- SerbianVat
- Provides the Serbian VAT tax number type.
Namespace
Drupal\commerce_tax_test\Plugin\Commerce\TaxNumberTypeCode
public function validate($tax_number) {
// All numbers smaller than 1000 are valid.
return is_numeric($tax_number) && $tax_number < 1000;
}