Ok, as promised, I made a patch on 1.3 branch in order to add NestedSet support.

I didn't commit it because, I am not currently satisfied.
Indeed, it is fully usable but it requires to use a specific Stub and StubPeer in parallel with default ones.

So I decided to work now on an really integrated way to use NestedSet in a transparent way...

Now provided features:
Example insertion usage
$menu = new MenuNestedSet();


$child = new MenuNestedSet();
$child->setText('Google Mail');

$child = new MenuNestedSet();
$child->setText('Google Maps');

$sibling = new MenuNestedSet();

$child = new MenuNestedSet();
$child->setText('Yahoo! Mail');


Example Ttaversal usage
    $node = MenuNestedSetPeer::retrieveRoot();
    $level = 0;
    foreach($element as $node) {
        if($level < $node->getLevel()) {
            // Go deep (to leaf) in tree
        } else if ($level > $node->getLevel()) {
            // Go up (to root) in tree
        } else {
            // Stay in same level
        $level = $node->getLevel();

Enjoy it.

Happy X-Mas

On 12/18/06, Eric Fredj <eofredj@gmail.com> wrote:
Ok, I didn't take a look on 1.3 branch until now but I think I can adapt the patch quickly.
I will try to produce before X-Mas.
By that time, I will attach the 1.2 patch on a Trac ticket when phpdb.org will be up :-)

About coding guidelines, I tried to follow NodePeerBuilder* convention and all I was able to read on Trac Wiki but feel free to comment and make feedback ...

PS :I asked for SVN account a few minutes ago ..


On 12/18/06, Hans Lellelid < hans@velum.net> wrote:
Hi Eric,

Makes sense, ok.  I think that this makes most sense in the 1.3 branch,
as it would break 1.2 BC (and 1.3 is not far from being ready).  So, if
you want to create a ticket (or find that original ticket, if there is
one) and commit this stuff to 1.3, please do (and thanks!).  Please see
coding & contributing guidelines, of course.  Also let me know if you
need SVN account.


Eric Fredj wrote:
> I forgot the main : I obviously made some specific NestedSet builder
> for Base classes and Stub classes ...
> On 12/18/06, *Eric Fredj* < eofredj@gmail.com
> <mailto:eofredj@gmail.com>> wrote:
>     Patch was made in mind to be integrated in main tree because it
>     requires some changes on the core:
>         * database.xsd was updated to support some new attributes in
>           schema.xml
>               o In fact, I replaced isTree by treeMode in Table
>                 attribute to support several mode
>               o I added some Column attribute to target left and right
>                 fields
>         * PropelOMTask.php was modified to managed the new treeMode
>           and call the new builder I added when needed
>         * Column.php and Table.php to handle their new attributes
>         * OMBuilder.php to handle new attributes and builder getter as
>           it is done for Node builder
>     Maybe the right way to share would be to create a parallel
>     1.2-nestedset (or something else) branch in which I could commit
>     my job, improve it, fix it before you can merge it with main 1.2
>     officiel branch.
>     Moreover, it could be more easy to develop the same patch for 1.3
>     then...
>     On 12/18/06, *Hans Lellelid* < hans@velum.net
>     <mailto: hans@velum.net>> wrote:
>         Hi Eric,
>         Depending on what it is you've been creating, I think we can
>         either add
>         it to contrib or integrate it into main tree.  My preference
>         would be to
>         add it to the contrib directory in SVN.  I can get you an SVN
>         account if
>         you don't have one yet (please email offlist w/ desired username).

To unsubscribe, e-mail: dev-unsubscribe@propel.tigris.org
For additional commands, e-mail: dev-help@propel.tigris.org