diff --git a/.gitignore b/.gitignore index 0ee1ad3..48e2d13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /build /vendor composer.lock -composer.phar \ No newline at end of file +composer.phar +.idea/ \ No newline at end of file diff --git a/README.md b/README.md index 0657de7..485546e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Installation of this module uses composer. For composer documentation, please re [getcomposer.org](http://getcomposer.org/). ```sh -$ php composer.phar require hounddog/doctrine-data-fixture-module:0.0.* +$ php composer.phar require herbertscruz/doctrine-data-fixture-module:0.0.* ``` Then open `config/application.config.php` and add `DoctrineModule`, `DoctrineORMModule` and diff --git a/composer.json b/composer.json index dc2e8d5..9aaad50 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "hounddog/doctrine-data-fixture-module", + "name": "herbertscruz/doctrine-data-fixture-module", "description": "Zend Framework 2 Module that provides Doctrine Data-Fixture functionality", "type": "library", "license": "MIT", @@ -14,6 +14,10 @@ { "name": "Martin Shwalbe", "email": "martin.shwalbe@gmail.com" + }, + { + "name": "Herberts Cruz", + "email": "herbertscruz@gmail.com" } ], "require": { @@ -33,5 +37,6 @@ "psr-0": { "DoctrineDataFixtureModule": "src/" } - } + }, + "minimum-stability": "dev" } diff --git a/src/DoctrineDataFixtureModule/Service/FixtureFactory.php b/src/DoctrineDataFixtureModule/Service/FixtureFactory.php index 223ec56..edd3c85 100644 --- a/src/DoctrineDataFixtureModule/Service/FixtureFactory.php +++ b/src/DoctrineDataFixtureModule/Service/FixtureFactory.php @@ -35,27 +35,32 @@ class FixtureFactory implements FactoryInterface public function createService(ServiceLocatorInterface $sl) { /** @var $options \DoctrineORMModule\Options\DBALConnection */ - $options = $this->getOptions($sl, 'fixtures'); - + $options = $this->getOptions($sl, 'fixture'); + return $options; } /** * Gets options from configuration based on name. * - * @param ServiceLocatorInterface $sl - * @param string $key - * @param null|string $name + * @param ServiceLocatorInterface $sl + * @param string $key * @return \Zend\Stdlib\AbstractOptions - * @throws \RuntimeException + * @internal param null|string $name */ public function getOptions(ServiceLocatorInterface $sl, $key) { - $options = $sl->get('config'); - if (!isset($options['doctrine']['fixture'])) { + $options = $sl->get('Configuration'); + + if (!isset($options['doctrine'][$key])) { return array(); } - - return $options['doctrine']['fixture']; + + return $options['doctrine'][$key]; + } + + public function getOptionsClass() + { + return 'DoctrineDataFixtureModule\Options\Fixture'; } }