We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 559127b commit fb4cc71Copy full SHA for fb4cc71
1 file changed
Form/DataTransformer/Entity/AbstractEntityTransformer.php
@@ -86,7 +86,11 @@ function ($child) {
86
protected function extractLabel($object)
87
{
88
if ($this->property) {
89
- return $this->accessor->getValue($object, $this->property);
+ if ($this->property instanceof \Closure) {
90
+ return $this->property->__invoke($object);
91
+ } else {
92
+ return $this->accessor->getValue($object, $this->property);
93
+ }
94
} elseif (method_exists($object, '__toString')) {
95
return (string)$object;
96
} else {
0 commit comments