theofidry on master
Fixed root_node deprecation wit… (compare)
roles: ['@RoleUser','@RoleAdmin']
Type error: Argument 1 passed to UserBundle\Entity\User::setRoles() must be an instance of Doctrine\Common\Collections\ArrayCollection, array given,
The logic of DoctrineFixturesBundle is to have several loaders that creates fixtures, for which the order can matter. In HautelookAliceBundle the approach is different: you create a fixture file for each class, eg:
dummy.yml
foo.yml
bar.yml
Then the loader will try to load them one by one, injecting the result of the loaded file when loading the next one:
dummy.yml
foo.yml
with the result of dummy.yml
Then if some files could not be loaded, e.g. here foo.yml
because it requires some fixtures from bar.yml
, a second pass is done:
foo.yml
with the result of dummy.yml
and bar.yml
So the loader actually tries to load your files several times before giving up, having the right order might speed up a little bit (a few ms) the loading process but that's all
Finder
service used to re-order them the way you want, you cannot rely on anything else: discovering the bundles to load and the files result in a set of files in a random order. Even with the same config on the same machine the result may differ between a load and another
As you can see here, a call on Finder#getFixtures()
is made. So you can create a new finder service decorating the old one, and return the re-ordered fixtures.
An alternative is to decorate the Loader
to re-order the fixtures there instead, see https://github.com/hautelook/AliceBundle/blob/1.x/src/Alice/DataFixtures/Loader.php#L73
I just installed it and I get the following error:
[26-Jan-2017 12:44:07 Europe/Madrid] PHP Warning: Cannot open '/etc/browscap.ini' for reading in Unknown on line 0
[26-Jan-2017 12:44:07 Europe/Madrid] PHP Fatal error: Declaration of FidryAliceDataFixturesLoaderMultiPassLoader_000000004c46ea97000000004b86149d8b35cff2676aa6ed51f4ee74ee980241::load(array $fixturesFiles, array $parameters = Array, array $objects = Array) must be compatible with Fidry\AliceDataFixtures\LoaderInterface::load(array $fixturesFiles, array $parameters = Array, array $objects = Array): array in /var/www/vagrant/trovit.new/kolekti/cache/appDevDebugProjectContainer.php on line 28152
Fatal error: Declaration of FidryAliceDataFixturesLoaderMultiPassLoader_000000004c46ea97000000004b86149d8b35cff2676aa6ed51f4ee74ee980241::load(array $fixturesFiles, array $parameters = Array, array $objects = Array) must be compatible with Fidry\AliceDataFixtures\LoaderInterface::load(array $fixturesFiles, array $parameters = Array, array $objects = Array): array in /var/www/vagrant/trovit.new/kolekti/cache/appDevDebugProjectContainer.php on line 28152
Any clue?
D%? X: Y
10%? ‘@ref1’: ‘@ref2’
10%? ‘@ref1’
works, but when I try to add a second I can’t get the syntax right (in yaml).
{1..10}
?