doctrine-dbal-extensions is a library with extensions for the doctrine dbal project
The best way to install this library is to use composer.
{
"require": {
"schwaen/doctrine-dbal-extensions": "~1.*"
}
}
- PHP >= 5.4.0
- ext-pdo
- doctrine/dbal ~2.5
Getting the model object
$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
// other params... like the access
'wrapperClass' => '\Schwaen\Doctrine\Dbal\Connection',
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
//variant #1 (need the wrapperClass)
$model1 = $conn->getModel('table_name');
//variant #2 (no need of the wrapperClass)
$model2 = new \Schwaen\Doctrine\Dbal\Model('table_name', $conn);
Working with the model object
This library is available under the MIT license.