Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build
/vendor
composer.lock
composer.phar
composer.phar
.idea/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -14,6 +14,10 @@
{
"name": "Martin Shwalbe",
"email": "martin.shwalbe@gmail.com"
},
{
"name": "Herberts Cruz",
"email": "herbertscruz@gmail.com"
}
],
"require": {
Expand All @@ -33,5 +37,6 @@
"psr-0": {
"DoctrineDataFixtureModule": "src/"
}
}
},
"minimum-stability": "dev"
}
25 changes: 15 additions & 10 deletions src/DoctrineDataFixtureModule/Service/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}