Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 6ba64c2

Browse files
committed
added some docs for the migrator
1 parent 19669a1 commit 6ba64c2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

bundles/phpcr-odm.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ To use the ``doctrine:phpcr:fixtures:load`` command, you additionally need to in
683683

684684
Fixtures work the same way they work for Doctrine ORM. You write fixture classes implementing
685685
``Doctrine\Common\DataFixtures\FixtureInterface``. If you place them in <Bundle>\DataFixtures\PHPCR,
686-
they will be autodetected if you specify no path to the fixture loading command.
686+
they will be auto detected if you specify no path to the fixture loading command.
687687

688688
A simple example fixture class looks like this:
689689

@@ -707,6 +707,23 @@ A simple example fixture class looks like this:
707707
708708
For more on fixtures, see the `documentation of the DoctrineFixturesBundle <http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html>`_.
709709

710+
Migration loading
711+
-----------------
712+
713+
The DoctrinePHPCRBundle also ships with a simple command to run migration scripts. Migrations
714+
should implement the ``Doctrine\Bundle\PHPCRBundle\Migrator\MigratorInterface`` and registered
715+
as a service with a ``doctrine_phpcr.migrator`` tag contains an ``alias`` attribute uniquely
716+
identifying the migrator. There is an optional ``Doctrine\Bundle\PHPCRBundle\Migrator\AbstractMigrator``
717+
class to use as a basis. To find out available migrations run:
718+
719+
.. code-block:: bash
720+
721+
$ php app/console doctrine:phpcr:migrator
722+
723+
Then pass in the name of the migrator to run it, optionally passing in an ``--identifier``,
724+
``--depth`` or ``--session`` argument. The later argument determines which session name to
725+
set on the migrator, while the first two arguments will simply be passed to the ``migrate()``
726+
method. You can find an example migrator in the SimpleCmsBundle.
710727

711728
Doctrine PHPCR Commands
712729
-----------------------

0 commit comments

Comments
 (0)