I am using symfony2 with the sonata admin bundle. Now I have an entity which has OneToOne association to another entity. I want the embed the show form of the child entity into the show form of the parent entity.
I have tried the form type "sonata_type_admin" but that only gives me a link to the sub entity.
Does anybody have a clue how to embed the show form of the sub entity?
Entity definitions:
Parent:
class Parent
{
/**
* @ORM\OneToOne(targetEntity="Child", mappedBy="parent")
*/
private $child;
}
Child:
class Child
{
/**
* @ORM\OneToOne(targetEntity="Parent", mappedBy="child")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
* })
*/
private $parent;
}