Skip to content
Advertisement

Tag: formbuilder

CollectionType elements missing data

I’ve embedded forms with CollectionType: and ‘battlePages’ is an ArrayCollection with many elements. But ‘$entity’ is empty however collection was walking through. My goal would be to get BattlePage entity’s data in the ‘BattlePageCollectionType’ which is my second in examples ($entity). Anybody had have similar issues? Answer The $builder->getData(); method doesn’t return an entity. You should use Form Events Example

Advertisement