You are here

protected function NameFormatter::getNameFormatString in Name Field 8

Helper function to get the format pattern.

Parameters

string $format: The ID of the preferred format to use. This will fallback to the default format if the format can not be loaded.

Return value

string The pattern to parse.

1 call to NameFormatter::getNameFormatString()
NameFormatter::format in src/NameFormatter.php
Formats an array of name components.

File

src/NameFormatter.php, line 221

Class

NameFormatter
Primary name formatter for an array of name components.

Namespace

Drupal\name

Code

protected function getNameFormatString($format) {
  $config = $this->nameFormatStorage
    ->load($format);
  if (!$config) {
    $config = $this->nameFormatStorage
      ->load('default');
  }
  return $config
    ->get('pattern');
}