[Documentation] [Fixtures] Built-in listeners section

This commit is contained in:
Kamil Kokot 2016-06-21 11:17:01 +02:00
parent 48bde3375a
commit 9839331bd5
No known key found for this signature in database
GPG key ID: 7BD76F7054D93C89
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,80 @@
Built-in listeners
==================
**SyliusFixturesBundle** comes bundled with a few useful listeners.
Logger (``logger``)
-------------------
Provides output during running ``sylius:fixtures:load`` command.
.. code-block:: bash
# Without logger
$ app/console sylius:fixtures:load my_suite
$ _
# With logger
$ app/console sylius:fixtures:load my_suite
Running suite "my_suite"...
Running fixture "country"...
Running fixture "locale"...
Running fixture "currency"...
$ _
Has no configuration options, can be enabled by:
.. code-block:: yaml
sylius_fixtures:
suites:
my_suite:
listeners:
logger: ~
ORM Purger (``orm_purger``)
---------------------------
Purges the relational database. Uses ``delete`` purge mode and the default entity manager if not configured otherwise.
Configuration options:
- ``purge_mode`` - sets how databse is purged, available values: ``delete`` (default), ``truncate``
- ``managers`` - array of entity managers names used to purge the database, ``[null]`` by default
Example configuration:
.. code-block:: yaml
sylius_fixtures:
suites:
my_suite:
listeners:
orm_purger:
purge_mode: truncate
managers:
- custom_manager
PHPCR / MongoDB Purger (``phpcr_purger`` / ``mongodb_purger``)
--------------------------------------------------------------
Purges the document database. Uses the default document manager if not configured otherwise.
Configuration options:
- ``managers`` - array of document managers names used to purge the database, ``[null]`` by default
Example configuration:
.. code-block:: yaml
sylius_fixtures:
suites:
my_suite:
listeners:
phpcr_purger:
managers:
- custom_manager # Uses custom document manager
mongodb_purger: ~ # Uses default document manager

View file

@ -10,4 +10,5 @@ Configurable fixtures management for Symfony2 applications.
installation
architecture
custom_fixture
builtin_listeners
summary