bedd/doctrine-dbal-extensions

doctrine dbal 项目的扩展

dev-master 2017-03-09 21:38 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:20:45 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality

安装

安装此库的最佳方式是使用 composer.

{
    "require": {
        "bedd/doctrine-dbal-extensions": "1.*"
    }
}

用法

获取模型

$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
    // other params... like the access
    'wrapperClass' => '\Bedd\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 \Bedd\Doctrine\Dbal\Model('table_name', $conn);```

### Working with a model
```php
//@todo

许可证

此库可在 MIT 许可证 下使用。