Depuis symfony2.1, je ne peut plus enregistrer de clef étrangère.
Mon appli fonctionner très bien en sf2.0.
Que faut-il faire pour enregistrer une clef étrangère dans doctrine2 ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
               //mes données 24 / 59 / 50
               echo '<br>B-' . $product_type_id . ' / ' . $user_categorie->getId() . ' / ' . $value_defaut;
 
                $pourcentage_reduc = new PourcentageReduc();
                $pourcentage_reduc->setProductTypeId($product_type_id);
                $pourcentage_reduc->setUserCategoryId($user_categorie->getId());
                $pourcentage_reduc->setPourcentage($value_defaut);
                $this->_em->persist($pourcentage_reduc);
                $this->_em->flush();
resultat:
An exception occurred while executing 'INSERT INTO pourcentage_reduc (product_type_id, user_category_id, pourcentage) VALUES (?, ?, ?)' with params {"1":null,"2":null,"3":"50"}:

les valeurs des clef étrangère sont null !!! pourquoi doctrine2 efface les clef avant l'enregistrement?