Hello ,
i would like to know if is possible to embed on the declaration of an Admin form a relationship one to many with a subclass entity. Im following the example of
demo.sonata-project.org for car entity, and this is my case:
Class Family
/**
* @ORM\OneToMany(targetEntity="FamilyChild", mappedBy="family")
*/
private $childs;
**
* @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({"ProspectChild"="ProspectChild","FamilyChild"="FamilyChild"})
*/
Class Child
...some fields
/**
* @ORM\Entity
*/
class FamilyChild extends Child
{
... some fields
this is my admin service declaration:
<service id="eenfants.family.admin.child" class="Eenfants\FamilyBundle\Admin\ChildAdmin">
<tag name="sonata.admin" manager_type="orm" group="Demo" label="Car" />
<argument />
<argument>Eenfants\FamilyBundle\Entity\Child</argument>
<argument />
<call method="setSubClasses">
<argument type="collection">
<argument key="FamilyChild">Eenfants\FamilyBundle\Entity\FamilyChild</argument>
<argument key="ProspectChild">Eenfants\FamilyBundle\Entity\ProspectChild</argument>
</argument>
</call>
</service>
this is what im doing on my form declaration:
/**
* @param FormMapper $formMapper
*/
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper ->add('childs','sonata_type_collection', array('by_reference' => false), array(
'edit' => 'inline',
'inline' => 'table',
'link_parameters' => array('subclass' => 'FamilyChild'),
'admin_code' => 'eenfants.family.admin.child')
but is not working , im getting this exception:
Feature not implemented: an embedded admin cannot have subclass
some help would be highly appreciated!
best