The best solution I can propose on first glance is to update to doctrine/data-fixture version 1.3 and extend the loader overriding the createFixture($class) method to retrieve the fixture from the service manager.
If you're happy with this approach, I can look at providing a PR with test and implementation.
(As stated in the readme) If I have the following configuration:
with
DependentFixure
implementingDoctrine\Common\DataFixtures\DependentFixtureInterface
and havingStandardFixture
as a dependency, then due to https://github.com/doctrine/data-fixtures/blob/v1.1.1/lib/Doctrine/Common/DataFixtures/Loader.php#L138 the StandardFixture is added first via the loader as a simple$this->addFixture(new $class);
.The best solution I can propose on first glance is to update to
doctrine/data-fixture
version 1.3 and extend the loader overriding thecreateFixture($class)
method to retrieve the fixture from the service manager.If you're happy with this approach, I can look at providing a PR with test and implementation.