I need help with sonata_type_collection: is there a way to determine the default value (here: an instance of an existing entity) for a specific sonata_type_collection field? Or maybe a way to give it options?
Let me clarify this: Here is a screenshot of my actual form "sonata_type_collection" after rendering:

Is there a way to make the "Machine" field hold the current instance of the "MachineInfo" object, which I edit instead of the text "Without selection" when you click the "Add" button (very last)?
Here are my current "configureFormFields" from "MachineInfoAdmin":
protected function configureFormFields(FormMapper $formMapper) { $formMapper ->add('name', 'text', array('label' => 'Nom')) ->add('description', 'text', array('label' => 'Description')) ->add('internalReference', 'text', array('label' => 'Référence interne')) ; //Already instantiated if ($this->id($this->getSubject())) { $formMapper ->add( 'machineParts', 'sonata_type_collection', array( 'label' => "Pièces", ), array( 'edit' => 'inline', 'inline' => 'table', 'sortable' => 'position', ) ) ; } }
I'm really stuck with this, I hope the savior can provide me with his knowledge to help me m (_ _) m
symfony sonata-admin sonata
Sir McPotato
source share