1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/docs/Object relational mapping - Hierarchical data - Introduction - Setting up.php
2007-04-13 21:49:11 +00:00

11 lines
686 B
PHP

Managing tree structures in doctrine is easy. Doctrine currently fully supports Nested Set, and plans to support the other implementations soon. To set your model to act as a tree, simply add the code below to your models table definition.
Now that Doctrine knows that this model acts as a tree, it will automatically add any required columns for your chosen implementation, so you do not need to set any tree specific columns within your table definition.
Doctrine has standard interface's for managing tree's, that are used by all the implementations. Every record in the table represents a node within the tree (the table), so doctrine provides two interfaces, Tree and Node.