2017 © Pedro Peláez
 

library doctrine-odm-datafixture

Module to generate fixture with Doctrine ODM

image

diegograssato/doctrine-odm-datafixture

Module to generate fixture with Doctrine ODM

  • Tuesday, July 3, 2018
  • by diego.grassato
  • Repository
  • 4 Watchers
  • 3 Stars
  • 56 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

DoctrineMongoODMDatafixture

Module to generate fixture with Doctrine ODM, (*1)

Instalation

To install is quite simple, add the composer.json:, (*2)

    "diegograssato/doctrine-odm-datafixture": "2.0"

Next step is to update the composer, (*3)

  composer self-update
  composer install

Then add DoctrineMongoODMDatafixture to your config/application.config.php., (*4)

In module.config.php you should inform the folder where your fixtures, for example:, (*5)

  'odm_fixtures' => [
     __DIR__.'/../src/Fixtures',
  ]

or group configurator, (*6)

    'odm_fixtures' => [
        'groups' => [
            'default' => [
                __DIR__.'/../MyModule/src/MyModule/Fixtures/default',
            ],
            'production' => [
                 __DIR__.'/../MyModule/src/MyModule/Fixtures/production',
            ]
        ]
    ]

To rotate the fixture use the terminal command:, (*7)

  vendor/bin/doctrine-odm-datafixture odm:fixtures:load

The odm:fixture:load command loads data fixtures from your bundles:, (*8)

  vendor/bin/doctrine-module odm:fixtures:load

You can also optionally specify the path to fixtures with the --fixtures option:, (*9)

  vendor/bin/doctrine-module odm:fixtures:load --fixture=/path/to/fixtures1 --fixture=/path/to/fixtures2

If you want to append the fixtures instead of flushing the database first you can use the --append option:, (*10)

  vendor/bin/doctrine-module odm:fixture:load --fixture=/path/to/fixtures1 --fixture=/path/to/fixtures2 --append

You can also optionally specify the group configuration:, (*11)

  vendor/bin/doctrine-module odm:fixtures:load --group production

You can also optionally list the fixtures:, (*12)

  vendor/bin/doctrine-module odm:fixtures:list --group production

Finish!, (*13)

The Versions