Explorar el Código

Merge pull request #993 from mweimerskirch/patch-12

Display public field values in the list
Thomas hace 12 años
padre
commit
63e95a036d
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      Admin/BaseFieldDescription.php

+ 4 - 1
Admin/BaseFieldDescription.php

@@ -322,13 +322,16 @@ abstract class BaseFieldDescription implements FieldDescriptionInterface
         $getters[] = 'get' . $camelizedFieldName;
         $getters[] = 'is' . $camelizedFieldName;
 
-
         foreach ($getters as $getter) {
             if (method_exists($object, $getter)) {
                 return call_user_func(array($object, $getter));
             }
         }
 
+        if (isset($object->{$fieldName})) {
+            return $object->{$fieldName};
+        }
+
         throw new NoValueException(sprintf('Unable to retrieve the value of `%s`', $this->getName()));
     }