Skip to content

Commit

Permalink
Merge pull request #23 from Hounddog/change_config
Browse files Browse the repository at this point in the history
Moved configuration to doctrine key. Fixes #1
  • Loading branch information
Ocramius committed Dec 16, 2013
2 parents 4f09fd9 + 1b487a8 commit 6beeb4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ Then open `config/application.config.php` and add `DoctrineModule`, `DoctrineORM

#### Registering Fixtures

To register drivers with Doctrine module simply add the drivers to the doctrine.driver key in your configuration.
To register fixtures with Doctrine module add the fixtures to the doctrine key in your configuration.

```php
<?php
return array(
'data-fixture' => array(
'ModuleName_fixture' => __DIR__ . '/../src/ModuleName/Fixture',
'doctrine' => array(
'fixture' => array(
'ModuleName_fixture' => __DIR__ . '/../src/ModuleName/Fixture',
)
),
);
```
Expand All @@ -47,6 +49,7 @@ return array(
#### Command Line
Access the Doctrine command line as following

##Import
```sh
./vendor/bin/doctrine-module
./vendor/bin/doctrine-module data-fixture:import
```
11 changes: 3 additions & 8 deletions src/DoctrineDataFixtureModule/Service/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,11 @@ public function createService(ServiceLocatorInterface $sl)
*/
public function getOptions(ServiceLocatorInterface $sl, $key)
{
$options = $sl->get('Configuration');
if (!isset($options['data-fixture'])) {
$options = $sl->get('config');
if (!isset($options['doctrine']['fixture'])) {
return array();
}

return $options['data-fixture'];
}

public function getOptionsClass()
{
return 'DoctrineDataFixtureModule\Options\Fixture';
return $options['doctrine']['fixture'];
}
}

0 comments on commit 6beeb4f

Please sign in to comment.