I have an Entity with two CollectionType but when I dump this entity I just have one with the ArrayCollection.
In my orderproductType I put this code :
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('dimension')
->add('product', CollectionType::class, array(
'entry_type' => ProductType::class,
'allow_add' => true,
))
->add('machining', CollectionType::class, array(
'entry_type' => MachiningType::class,
'allow_add' => true,
))
->add('save', SubmitType::class)
;
}
And in my entity :
/**
* @ORM\OneToMany(targetEntity="ProductBundle\Entity\Product", mappedBy="Orderproduct")
*/
private $product;
/**
* @ORM\OneToMany(targetEntity="ProductBundle\Entity\Machining", mappedBy="Orderproduct")
*/
private $machining;
- add / remove and get.
Any idea ?
Thx