mouf / database.doctrine-dbal-wrapper
This package contains wrapper classes that make Doctrine DBAL easy to use in Mouf
Installs: 109 693
Dependents: 5
Suggesters: 0
Security: 0
Stars: 0
Watchers: 15
Forks: 3
Open Issues: 0
Type:mouf-library
Requires
- php: >=5.3.0
- doctrine/dbal: ~2.4
- mouf/utils.console: ~1.0
- psr/log: ~1.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
README
This package provides a wrapper around the Doctrine's DBALConnection class for the Mouf PHP framework.
Important: this component has not been tested yet for other connection drivers than PDO_MYSQL and MSQLI.
When installed, it provides a user-friendly user interface that allows to create / edit your connection to the database.
Please be aware this is a very simple wrapper. In fact this component is just a simple install task, that will automatically configure a Doctrine/DBAL Connection :
- the params property is stored as a PHP field as it's structure is not really defined. It will return an array of connection parameters : database's host, name, and identifiers.
Please note, that those parameters will be stored in Mouf configuration.
- driver & eventManager are simple classes that has no settable properties. Note that as required by Doctrine, if the ORM layer is included in your project, the entityManager instance will be associated to the same eventManager instance that the connection.
- the configuration property is not set by this package.
Other parameters can be defined after the instance has been initialized, please refer to doctrine's documentation for more information : http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/.
Usage
You can now embed the dbalConnection
instance anywhere in your code:
$stmt = Mouf::getDbalConnection()->query($sql);