creocoder / yii2-nested-sets

The nested sets behavior for the Yii framework.
Other
446 stars 129 forks source link

How to use this extension when hierarchy is defined in database ( Need more info ) #60

Closed nenad-zivkovic closed 9 years ago

nenad-zivkovic commented 9 years ago

If I have my hierarchy defined in database table and it has 6 levels, can I use this extension to work with them all ?

I made a question on stack overflow, and people advised me to use your extension, but I am unsured how to use it, since I have to pull parents/chiledes from database and work with them.

creocoder commented 9 years ago

@nenad-zivkovic Depends on hierarchy tree type. If you have nested sets hierarchy you can work with that by using that behavior. If you have any other tree type first you need convert it to nested sets.

nenad-zivkovic commented 9 years ago

There are 45 top parents, each of that have their children, grandchildren and so on...

One of 45 top parents have id of 24000000 and its name is Chemical products.

His children have ids and names like this:

 24100000 : Gases  
 24200000 : Dyes and pigments  
 24300000 : Basic inorganic and organic chemicals  
 24400000 : Fertilisers and nitrogen compounds  
 24500000 : Plastics in primary forms  
 24600000 : Explosives  
 24900000 : Fine and various chemical products

If for example I click on 24100000 : Gases I need to get his children if he have it, and I need to provide link to go up one level to his parent.

Is this possible with your extension ?

Thanks

creocoder commented 9 years ago

Is this possible with your extension ?

Ofcourse

nenad-zivkovic commented 9 years ago

Amazing, thanks