Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is not a direct answer to your question, but it is a solution nonetheless.</p> <p>As you mention in a comment on the question: <strong>nested-set</strong> is the answer.</p> <p>At first this may sound like a way around the problem, but nested-set is the result of others having similar issues. It is well researched and a popular way to represent trees. Its main advantage is exactly the ability to manage variable-depth trees.</p> <p>You mention that you are new to Propel and that switching to nested-set would be quite a bit of work so I took the liberty to assume that you didn't use Propel's <em>behaviors</em> before. If that is the case, definitely read through the documentation section about <a href="http://propelorm.org/documentation/07-behaviors.html" rel="nofollow">Behaviors</a>.</p> <p>If you like Propel now, you will <em>love</em> it afterwards!</p> <p>To solve your question: look at <a href="http://propelorm.org/behaviors/nested-set" rel="nofollow">NestedSet Behavior</a>. As with all other behaviors, it is easy to add it to your schema. Regenerate your models and you will only need to do minor refactoring to your code (the examples will show you how).</p> <p>(Note: if you have an existing database, you will need to migrate that parent link to the nested set structure. But this is basically the only concern you should have.)</p> <p>An example to display an entire tree is available in the <a href="http://propelorm.org/behaviors/nested-set#using-a-recursiveiterator" rel="nofollow">Using a RecursiveIterator</a> section.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload