D
D
DileSoft2011-03-26 14:48:17
PHP
DileSoft, 2011-03-26 14:48:17

Any ready-made classes for building complex trees (a tree-like grouping of objects into different categories)?

Task: there are objects, objects have sets of characteristics. Let's say the characteristics are an address and a color. It is necessary to build a tree, where at the first level - the address, at the second - the color, at the third - the objects of these addresses and colors. Or vice versa - first the color, then the address. And there are more than two characteristics. The language is PHP. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nekufa, 2011-03-26
@nekufa

I didn’t find any ready-made classes, but it was a long time ago and I didn’t really look for it :)
When I faced such a task, I just collected everything in associative arrays:
pastebin.ru/317824

Z
zizop, 2011-03-26
@zizop

If we are talking about organizing and storing hierarchical data in a database, then I advise you to read the article " Hierarchical data structures and Doctrine " on Habré.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question