0

Here is scenario:

   id  parent_id  search
   1   null       hello
   2   1          hello/something
   3   1          hello/new
   4   null       new
   5   4          new/hello

Then I got via querybuilder and searching "hello" to this results:

   1   null       hello
   2   1          hello/something
   3   1          hello/new
   5   4          new/hello
   5   4          new/hello

How to build nested tree via querybuilder if I want only get all elements inside childs, include "hello/something" ?

How to build up using symfony to array?

1 Answer 1

0

Assuming you're using Doctrine, check out the tree extension in DoctrineExtensions

Sign up to request clarification or add additional context in comments.

2 Comments

I don't want to use Doctrine, I know for this, but i'm using LIKE statements.
If you can't use the doctrine extension, then just get it as an array and then look at this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.