私は、その特定のユーザーのトランザクションを保持する1対多のプロパティ "transactions"を含むUser Entityクラスを持っています。Symfony2:sonatabundleのconfigureListFieldsの1つのプロパティフィールドに1つずつ追加するにはどうすればいいですか?
私はソナタ管理クラスを拡張USERADMINクラスを持っているバックエンドで/**
* @param \Sonata\AdminBundle\Datagrid\ListMapper $listMapper
* @return void
*/
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->add('id')
->addIdentifier('username')
->add('transactions')
;
}
私はこれを行う場合、私は次のエラーを取得する:
An exception has been thrown during the rendering of a template ("You must define an
associated_tostring
option or create aProject\MyBundle\Entity\Transaction::__toString
method to the field option transactions from service gd_admin.customer_details is ") in SonataDoctrineORMAdminBundle:CRUD:list_orm_one_to_many.html.twig at line 17.
は、私がどのように理解していませんユーザーリストページでユーザートランザクションへのリンクを提供します。どんな助けも本当に素晴らしいでしょう。
ありがとうございました。