This package contains extensions for Doctrine ORM and MongoDB ODM that offer new functionality or tools to use Doctrine more efficiently. These behaviors can be easily attached to the event system of Doctrine and handle the records being flushed in a behavioral way.
3.0 focuses on refreshing this package for today's PHP. This includes:
Read the Upgrade Doc for more info.
composer require gedmo/doctrine-extensions
All extensions support Attribute, XML and Annotation (deprecated) mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.
^3.2
(for all the extensions) or ^4.0
(for all the extensions, except Loggable)^2.14
or ^3.0
^2.3
If you are setting up the Entity Manager without a framework, see the example to prevent issues like #1310
XML mapping needs to be in a different namespace, the declared namespace for Doctrine extensions is http://gediminasm.org/schemas/orm/doctrine-extensions-mapping So root node now looks like this:
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
...
</doctrine-mapping>
XML mapping xsd schemas are also versioned and can be used by version suffix:
To set up and run the tests, follow these steps:
docker compose
docker compose up -d
to start containers in daemon modedocker compose exec php bash
(you are now in the root directory: /var/www
)composer install
vendor/bin/phpunit
To set up and run example, follow these steps:
composer install
example/em.php
and configure your database on top of the filephp example/bin/console
or php example/bin/console
for console commandsphp example/bin/console orm:schema-tool:create
to create the schemaphp example/bin/console app:print-category-translation-tree
to run the example to print the category translation treeThanks to everyone participating in the development of these great Doctrine extensions!
And especially ones who create and maintain new extensions: