Closed pierre-H closed 4 years ago
Here is where I think the dot magic happens. You might want to debug that part of the code.
Oh thank you ! I will debug this part and let you know ...
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Environment
Symfony 3.1.3 & Sonata Admin 3.4.0 with Doctrine
Sonata packages
Symfony packages
PHP version
Subject
Value of sub-object from ArrayCollection is null.
Steps to reproduce
I've got an entity EntityA which has a property entitiesB which is an ArrayCollection of EntityB.
EntityB has a property
private $helloWorld;
withgetHelloWorld()
.In EntityA I've got a function
getLastEntityB()
which works perfectly itself and return only one element from the array entitiesB (not the last one : it depends on a date property).The problem is when I add this code in the list configuration :
$listMapper->add('lastEntityB.helloWorld'),
The value is null, but if I add (with toString() ):
$listMapper->add('lastEntityB')
It works which means that lastEntityB is not null but when I want to access to helloWorld it's null.
In the show configuration :
$showMapper->add('getLastA.b', 'text', array('label'=>'MyLabel')