Download the PHP package arodax/doctrine-extensions-tree without Composer
On this page you can find all versions of the php package arodax/doctrine-extensions-tree. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arodax/doctrine-extensions-tree
More information about arodax/doctrine-extensions-tree
Files in arodax/doctrine-extensions-tree
Package doctrine-extensions-tree
Short Description Tree extension for Doctrine
License MIT
Informations about the package doctrine-extensions-tree
Hierarchical Tree extension for Doctrine
This extension allows you to store your data in hierarchicaly in your database using Doctrine ORM.
Note: this code is the hard fork of Atlantic18/DoctrineExtensions 2.4.x branch of the Tree extension only.
Licence
MIT
Changelog
- 3.2.3 Fixed cache item id generator
- 3.2.2 Automatically cache entity metadata when symfony/cache is installed.
- 3.2.1 Fixed class and file name mismatch for XML driver
- 3.2.0 Deprecated TreeRight, TreeLeft, TreeClosure, TreeRoot, TreePath, TreeLevel annotations, use them without "Tree" prefix (e.g. Right, Left, Closure ...)
- 3.2.0 Added native PHP attributes support
- 3.1.0 Renamed TreeAdapterInterface to AdapterInterface
- 3.0.0 Changed namespace to
Arodax\Doctrine\Extensions\Tree
, package has been renamed toarodax/doctrine-extensions-tree
. Make sure you change path and the namespace in config/packages/doctrine.yaml - see installation guide bellow for the example! - 2.0.0 Minimum compatible version of doctrine/common package has been increased to 3.0.*
- 1.0.3 Implementation of #2020 removed instances of hard coded parent column in queries
-
1.0.2 Added missing repositories from the original extension
- 1.0.1 Implementation of #2001 fixing problem causing wrong left/right order.
Installation
Install the extension with the composer
composer require arodax/doctrine-extensions-tree
Using in the Symfony project
There is no flex recipe yet, so you need to manually enable extension by adding the following into your configuration files
config/packages/doctrine.yaml
config/services/doctrine.yaml
Prepare entity for the hierarchical tree
Annotate your entity:
Extend the repository
Extend your entity repository from Arodax\Doctrine\Extensions\Tree\Entity\Repository\NestedTreeRepository
this allows you to use special methods for working with the tree:
Usage
Saving tree
Save some categories:
The result after flush will generate the food tree:
Inserting node in different positions
Using repository functions
For more examples and usage check original package documentation: https://github.com/Atlantic18/DoctrineExtensions/blob/v2.4.x/doc/tree.md