How to access PDO? #1867
-
Just upgraded to Propel2 and I'm having trouble accessing the PDO object. The main issue is that I have a Sabre library (for processing CalDAV requests) that requires the PDO connection to my database as a parameter.
Initially I had used this option:
However that was passing a ConnectionWrapper object - not what I was after.
However even with this option I'm still getting an error, like this:
How do I extract the actual PDO object from Propel that I can pass to this function? Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Oh, I don't think this is possible at the moment. If you feel like using Propel to create PDO connections is a missing feature and want to create a PR, I think it would be interesting. Best, |
Beta Was this translation helpful? Give feedback.
Oh, I don't think this is possible at the moment.
In your case you would want Propel to create another connection (which it is not using itself) and then hand it to you. While I see how this would be convenient, it is currently not implemented from what I see. I also don't see a way how to access the connection information (host, user, password, etc).
So I guess easiest approach is to create a new connection yourself, from connection information you get from outside Propel.
If you feel like using Propel to create PDO connections is a missing feature and want to create a PR, I think it would be interesting.
Best,
Moritz