How to represent a Tree structure in native Zend/Db?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to represent a Tree structure in native Zend/Db?

BRampersad
This post has NOT been accepted by the mailing list yet.
Is there any way to represent a tree structure (Forum containing Threads, Threads containing posts etc) in the default Zend/Db or do i need to use DoctrineOrm tree extension to accomplish something like this with minimal sql overhead. Of course this can be done with raw sql but i'm wondering if this data structure is built into the models.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: How to represent a Tree structure in native Zend/Db?

Marco Pivetta
This post has NOT been accepted by the mailing list yet.
The models themselves don't have any knowledge of the materialized path or the nested set. Your entities only know parents and children eventually :)

The gateway has to deal with the SQL abstraction needed to handle such an architecture. In the end, the logic to be implemented would be almost the same of what you find in https://github.com/l3pp4rd/DoctrineExtensions/tree/master/lib/Gedmo/Tree , but with some changes in implementation details because hydration is handled in the TDG itself.



On 3 February 2013 02:43, BRampersad [via Zend Framework Community] <[hidden email]> wrote:
Is there any way to represent a tree structure (Forum containing Threads, Threads containing posts etc) in the default Zend/Db or do i need to use DoctrineOrm tree extension to accomplish something like this with minimal sql overhead. Of course this can be done with raw sql but i'm wondering if this data structure is built into the models.

Thanks


If you reply to this email, your message will be added to the discussion below:
http://zend-framework-community.634137.n4.nabble.com/How-to-represent-a-Tree-structure-in-native-Zend-Db-tp4658926.html
To start a new topic under Zend DB, email [hidden email]
To unsubscribe from Zend Framework Community, click here.
NAML