ShowMapper type hints $name on FieldDescriptionInterface, so the method should be there.
@@ -239,4 +239,11 @@ interface FieldDescriptionInterface
* @return int|string
*/
function getMappingType();
+
+ /**
+ * return the label to use for the current field
+ *
+ * @return string
+ */
+ function getLabel();
}
@@ -75,7 +75,7 @@ class ShowMapper
throw new \RuntimeException('invalid state');
- if (!$fieldDescription->getOption('label')) {
+ if (!$fieldDescription->getLabel()) {
$fieldDescription->setOption('label', $this->admin->getLabelTranslatorStrategy()->getLabel($fieldDescription->getName(), 'show', 'label'));