Stars: 3935
Forks: 1266
Pull Requests: 1277
Issues: 1419
Watchers: 82
Last Updated: 2023-09-12 12:24:28
Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable
License: MIT License
Languages: PHP, Dockerfile, Makefile
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, Annotation and XML mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.
Extensions Version | Compatible Doctrine ORM & Common Library |
---|---|
2.4 | 2.5+ |
2.3 | 2.2 - 2.4 |
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
bin/phpunit -c tests/
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: