mercredi 6 juillet 2016

Reuse PDO instance in Propel 2

Is there a way to reuse a PDO instance with Propel 2? I would like to do something like...

Propel::setPDO($myPdoInstance);

... so that I can continue the transaction that $myPdoInstance already opened. I already tried using the PDO instance as a second argument for the findOneById method, but that did not work.

Why am I trying this? Because I am trying to use Laravel DatabaseTransactions trait for testing but Propel opens a new transaction and the data inserted using Laravel factories is not visible to Propel's PDO instance (and transaction).

Thanks in advance!!!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire