Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Is there a way to access the PDO object inside of a Phalcon\Db\Adapter\Pdo object?

Is there a way to access the PDO object inside of a Phalcon\Db\Adapter\Pdo object? I need to integrate with Symfony for a CLI Ratchet program and I'm wondering if I can pull the PDO object out of the database in the phalcon DI.

Also I didn't see a database category in the forum.



83.0k
Accepted
answer

Just call the method getInternalHandler() on the connection:

$connection = new \Phalcon\Db\Adapter\Pdo\Mysql($config);
$pdo = $connection->getInternalHandler();