class FieldGroupConverter in Field Group 8
Same name and namespace in other branches
- 8.3 src/Routing/FieldGroupConverter.php \Drupal\field_group\Routing\FieldGroupConverter
Parameter converter for upcasting fieldgroup config ids to fieldgroup object.
Hierarchy
- class \Drupal\field_group\Routing\FieldGroupConverter implements ParamConverterInterface
Expanded class hierarchy of FieldGroupConverter
1 string reference to 'FieldGroupConverter'
1 service uses FieldGroupConverter
File
- src/
Routing/ FieldGroupConverter.php, line 10
Namespace
Drupal\field_group\RoutingView source
class FieldGroupConverter implements ParamConverterInterface {
/**
* {@inheritdoc}
*/
public function applies($definition, $name, \Symfony\Component\Routing\Route $route) {
return isset($definition['type']) && $definition['type'] == 'field_group';
}
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
$identifiers = explode('.', $value);
if (count($identifiers) != 5) {
return;
}
return field_group_load_field_group($identifiers[4], $identifiers[0], $identifiers[1], $identifiers[2], $identifiers[3]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldGroupConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
|
FieldGroupConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides ParamConverterInterface:: |