当我使用:
public function configureFields(string $pageName): iterable
{
return [
AssociationField::new('XYZ')
];
}`
我收到了错误信息"Object of class App\Entity\XYZ could not be converted to string"
当我在AssociationField::new('XYZ')
中添加->autocomplete()
时,它可以工作,但在保存时显示错误"Expected argument of type "?string", "App\Entity\XYZ" given at property path "XYZ".
使用多对一关系的这个字段的正确方法是什么?Symfony Easy Admin文档 https://symfony.com/doc/current/EasyAdminBundle/fields/AssociationField.html没有提供有效的帮助。