[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-20 Thread StefanM
Hello, symfonians, After a 3 day struggle with nested sets, I'm near insanity. Please give me a hand, any hint is appreciated. I have a table of articles (pages), each article can be root (no parent), or have descendants (the point is to have, in frontend, a CSS menu generated from db). === con

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-20 Thread lionslair
Yeah I thought it was automated but after looking at it more it does not appear to be. Not that I can tell. On Nov 19, 11:09 pm, gestadieu <[EMAIL PROTECTED]> wrote: > thanks a lot, it helps me to understand how should work the 'scope', > this is a bit tricky and the only way I found is to save 2

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-19 Thread gestadieu
thanks a lot, it helps me to understand how should work the 'scope', this is a bit tricky and the only way I found is to save 2 times the first root element to set the scope to the element id. This is strange, I thought it would work automatically... thanks also for your nested dropdown, it might

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-19 Thread lionslair
I also make a tool class to generate the tree for use in a dropdown list as the symfony methods would not produce the formatting I needed. add(GalleryAlbumPeer::USER_ID, $userid); $c->add(GalleryAlbumPeer::TREE_PARENT, 0); $c->addAscendingOrderByColumn(GalleryAlbumPeer::TREE_LEFT); $c

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-19 Thread lionslair
Sure My action for adding a new album. Turns out that you make the root then set the id for that row . Continue setting your other values and call a second save. The other methods of the plugin then use the scope value as expected. /** * Execute action AddAlbum * */ public func

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-18 Thread gestadieu
Can you share your finding? I will have to deal with this plugin soon and I am interested to get your experience on this. Thx On Nov 18, 5:00 pm, lionslair <[EMAIL PROTECTED]> wrote: > I now got this sorted and working. > > On Nov 17, 4:52 pm, lionslair <[EMAIL PROTECTED]> wrote: > > > I need so

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-18 Thread lionslair
I now got this sorted and working. On Nov 17, 4:52 pm, lionslair <[EMAIL PROTECTED]> wrote: > I need some help with the nested sets plugin. I am adding a gallery > to my site and allowing members to add albums. They can add root > albums and sub albums but am not able to add child albums. > > H

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-17 Thread lionslair
Does the Scope filed get set manually by the user only when making the root node. How can you set a scope value when you have not yet saved the record? On Nov 18, 5:56 am, "Carsten Schumann" <[EMAIL PROTECTED]> wrote: > Hi! > > Your line > > $album->insertAsFirstChildOf($this->getRequestParamete

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-17 Thread lionslair
This method seems to have4 worked but the scope field of the table remains at 0 no matter how many root trees with x number of subs are created. Is this correct? /** * Execute action AddAlbum * */ public function executeAddAlbum() { if ($this->getRequest()->getMethod() !=

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-17 Thread lionslair
So I need to retrive from the database the record using the parentid field with propel and pass that to the function; $parentNode = GalleryAlbumPeer::retrievebypk($this- >getRequestParameter('album_parent_id')); $album->insertAsFirstChildOf($parentNode); I will give this a go let you know how I

[symfony-users] Re: sfPropelActAsNestedSetBehavior help

2007-11-17 Thread Carsten Schumann
Hi! Your line $album->insertAsFirstChildOf($this->getRequestParameter('album_parent_id')); is wrong. This function expects an object (the parent node) and not an id/pkey of the object. Carsten On Nov 17, 2007 8:52 AM, lionslair <[EMAIL PROTECTED]> wrote: > > I need some help with the nested s