I am trying to edit a record which have to choices and have to select value there.
$formMapper->add('addedBy', EntityType::class, [
'class' => 'AppBundle:User', 'choice_label' => function ($user) {
return $user->getFullName();
},
])
->add('medicalProvider', EntityType::class, [
'class' => 'AppBundle:MedicalProvider', 'choice_label' => function ($medicalProvider) {
return $medicalProvider->getName();
},
])
In Review section i have two entities form which i have to take values User and MedicalProvider , but when i load that things in choice_label, I am getting error like this.
: Allowed memory size of 134217728 bytes exhausted (tried to allocate 21348352 bytes) in : Uncaught Symfony\Component\Debug\Exception\OutOfMemoryException: Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 21348352 bytes) in D:\software\xampp\htdocs\meopin_2\trunk\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Profiler\FileProfilerStorage.php:158 Stack trace:
0 {main}
Next LogicException: Request stack is empty in D:\software\xampp\htdocs\meopin_2\trunk\var\cache\dev\classes.php:4690 Stack trace:
0 [internal function]: Symfony\Component\HttpKernel\HttpKernel->terminateWithException(Object(Symfony\Component\Debug\Exception\OutOfMemoryException))
1 D:\software\xampp\htdocs\meopin_2\trunk\var\cache\dev\classes.php(3323): call_user_func(Array, Object(Symfony\Component\Debug\Exception\OutOfMemoryException))
2 D:\software\xampp\htdocs\meopin_2\trunk\var\cache\dev\classes.php(3366): Symfony\Component\Debug\ErrorHandler->handleException(Object(Symfony\Component\Debug\Exception\OutOfMemoryException), Array)
3 [internal function]: Symfony\Component\Debug\ErrorHandler:: in classes.php.
Anyone can you please help me ?
Thanks in advance.