Download the PHP package ttl/doctrine-extensions without Composer
On this page you can find all versions of the php package ttl/doctrine-extensions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ttl/doctrine-extensions
More information about ttl/doctrine-extensions
Files in ttl/doctrine-extensions
Package doctrine-extensions
Short Description Doctrine behavioral extensions
License MIT
Homepage http://gediminasm.org/
Informations about the package doctrine-extensions
Doctrine Behavioral Extensions
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.
Doctrine Extensions 3.0 Released :tada:
3.0 focuses on refreshing this package for today's PHP. This includes:
- Bumping minimum version requirements of PHP, Doctrine, and other dependencies
- Implementing support for the latest Doctrine MongoDB & Common packages
- Updating the test suite, add code and style standards, and other needed build tools
- Cleaning up documentation, code, comments, etc.
Read the Upgrade Doc for more info.
Installation
composer require gedmo/doctrine-extensions
- Symfony 4
- Laravel 5
- Laminas
Upgrading
- From 2.4.x to 3.0
Extensions
ORM & MongoDB ODM
- Blameable - updates string or reference fields on create, update and even property change with a string or object (e.g. user).
- Loggable - helps tracking changes and history of objects, also supports version management.
- Sluggable - urlizes your specified fields into single unique slug
- Timestampable - updates date fields on create, update and even property change.
- Translatable - gives you a very handy solution for translating records into different languages. Easy to setup, easier to use.
- Tree - automates the tree handling process and adds some tree-specific functions on repository. (closure, nested set or materialized path) (MongoDB ODM only supports materialized path)
ORM Only
- IpTraceable - inherited from Timestampable, sets IP address instead of timestamp
- SoftDeleteable - allows to implicitly remove records
- Sortable - makes any document or entity sortable
- Uploadable - provides file upload handling in entity fields
MongoDB ODM Only
- References - supports linking Entities in Documents and vice versa
- ReferenceIntegrity - constrains ODM MongoDB Document references
All extensions support Attribute, Annotation and XML mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.
Version Compatibility
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
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:
XML mapping xsd schemas are also versioned and can be used by version suffix:
- Latest version - http://gediminasm.org/schemas/orm/doctrine-extensions-mapping
- 2.2.x version - http://gediminasm.org/schemas/orm/doctrine-extensions-mapping-2-2
- 2.1.x version - http://gediminasm.org/schemas/orm/doctrine-extensions-mapping-2-1
Running Tests
To set up and run the tests, follow these steps:
- Install Docker and ensure you have
docker compose
- From the project root, run
docker compose up -d
to start containers in daemon mode - Enter the container via
docker compose exec php bash
(you are now in the root directory:/var/www
) - Install Composer dependencies via
composer install
- Run the tests:
bin/phpunit -c tests/
Running the Example
To set up and run example, follow these steps:
- go to the root directory of extensions
- download composer
- install dev libraries:
composer install
- edit
example/em.php
and configure your database on top of the file - run:
php example/bin/console
orphp example/bin/console
for console commands - run:
php example/bin/console orm:schema-tool:create
to create the schema - run:
php example/bin/console app:print-category-translation-tree
to run the example to print the category translation tree
Contributors
Thanks to everyone participating in the development of these great Doctrine extensions!
And especially ones who create and maintain new extensions:
- Lukas Botsch lbotsch
- Gustavo Adrian comfortablynumb
- Boussekeyt Jules gordonslondon
- Kudryashov Konstantin everzet
- David Buchmann dbu
All versions of doctrine-extensions with dependencies
behat/transliterator Version ^1.2
doctrine/annotations Version ^1.13 || ^2.0
doctrine/collections Version ^1.2 || ^2.0
doctrine/common Version ^2.13 || ^3.0
doctrine/event-manager Version ^1.2 || ^2.0
doctrine/persistence Version ^2.2 || ^3.0
psr/cache Version ^1 || ^2 || ^3
symfony/cache Version ^4.4 || ^5.3 || ^6.0
symfony/deprecation-contracts Version ^2.1 || ^3.0