weew / app-doctrine
Integrates doctrine in to the weew/app package.
v1.17.0
2016-08-28 11:19 UTC
Requires
- doctrine/migrations: ^1.4
- doctrine/orm: ^2.5
- weew/app: ^2.0
- weew/config-schema: ^1.4
- weew/container-doctrine-integration: ^1.0
Requires (Dev)
- phpunit/phpunit: ^4.7
- satooshi/php-coveralls: ^0.6.1
README
Table of contents
Installation
composer require weew/app-doctrine
Introduction
This package integrates doctrine/orm and doctrine/migrations into the weew/app framework.
Usage
Simply register the DoctrineProvider
class on the application kernel:
$app = new App(); $app->getKernel()->addProviders([ DoctrineProvider::class, ]);
Example config
This is how your config might look like in yaml:
doctrine: debug: true cache_path: path/to/cache proxy_classes_path: path/to/proxies metadata_format: "yaml" or "annotations" # required if metadata_format is "annotations" entities_paths: path/to/entities: Namespace\To\Entities # required if metadata_format is "yaml" entities_mappings: app: path: path/to/entities namespace: Some\Entities bundle: path: path/to/bundle/entities namespace: Other\Entities config: driver: pdo_mysql host: database_hostname dbname: database_name user: database_user password: database_password migrations: namespace: migrations/namespace path: migrations/directory/path table: migrations_table_name
Doctrine console
You can run doctrine console tool like this:
$doctrineProvider->runConsoleRunner();