New in FixturesBundle: Group your Fixtures

public static function getGroups(): array { return ['group1', 'group2']; }}Once you have defined the group or groups each fixture class belongs to, pass the new –group option to load only the fixtures associated with those groups:# only load the 'group1' fixture classes$ ./bin/console doctrine:fixtures:load –group=group1# the '–group' option is multiple, so you can load several groups$ ./bin/console doctrine:fixtures:load –group=group1 –group=group2In order to improve your productivity, each fixture class is added to a group whose name matches the short name of the class..In the previous example, the class also belongs to a group named UserFixtures..This allows to load just one fixtures class:$ php bin/console doctrine:fixtures:load –group=UserFixturesThe new bundle version also includes other minor improvements and drops support for PHP 7.1 or earlier, as you can read in the DoctrineFixturesBundle 3.1.0 changelog.. More details

Leave a Reply