public function TaxNumberTypeBase::getFormattedExamples in Commerce Core 8.2
Gets the tax number examples, formatted for display.
Return value
string The formatted examples.
Overrides TaxNumberTypeInterface::getFormattedExamples
File
- modules/
tax/ src/ Plugin/ Commerce/ TaxNumberType/ TaxNumberTypeBase.php, line 36
Class
- TaxNumberTypeBase
- Provides the base class for tax number types.
Namespace
Drupal\commerce_tax\Plugin\Commerce\TaxNumberTypeCode
public function getFormattedExamples() {
$formatted_examples = '';
if ($this->pluginDefinition['examples']) {
$count = count($this->pluginDefinition['examples']);
$formatted_examples = $this
->formatPlural($count, 'Example: @data.', 'Examples: @data.', [
'@data' => implode(', ', $this->pluginDefinition['examples']),
]);
$formatted_examples = (string) $formatted_examples;
}
return $formatted_examples;
}