D
D
dblearn942019-12-13 12:17:15
SQL
dblearn94, 2019-12-13 12:17:15

How to check path in nested sets?

There is a nested sets tree of categories that contains a slug
, it looks something like this:

(это все slug)
- one
- - two
- - - three
- - three
- two

That is, url at different levels of nesting can be repeated, because the path is still different.
I can’t figure out how to check if the path to the category is correct?
/one/two/three
How to get the element three given the full path without making a separate request for each section?
UPD I could get the last element (three) and check its parents, but there can be several categories with the three slug, at the same nesting level, but with different parents

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question