Re: How set value for root parents using tree recover
On 24 nov, 23:31, Aldo abombe...@gmail.com wrote: I'm migrating a tree backend to cake. Unfortunately there are manay functions who depend from this value, as they look for -1 to identify a root entry. using -1 with the tree behavior will undoubtedly break it or at the very least make the tree behavior report your tree to be invalid. If you really really want to break the tree behavior I'd suggest you run recover and then updateAll(array('parent_id' = -1), array('parent_id' = null)); Or some other such permutation. Alternatively - why not capture the conditions used in the model and replace -1 with null. Or even better since it's obvious that you need to eventually need to change this, just do it right first time and replace all the -1s with nulls. hth, AD Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
How set value for root parents using tree recover
Hello, When using recover the parent_id fields for root entries are empty. Is there a way to set a default value like -1 as parent_id for root items? Thanks Aldo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: How set value for root parents using tree recover
On 24 nov, 21:48, Aldo abombe...@gmail.com wrote: Hello, When using recover the parent_id fields for root entries are empty. Is there a way to set a default value like -1 as parent_id for root items? why Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: How set value for root parents using tree recover
I'm migrating a tree backend to cake. Unfortunately there are manay functions who depend from this value, as they look for -1 to identify a root entry. On 24 Nov., 21:50, AD7six andydawso...@gmail.com wrote: On 24 nov, 21:48, Aldo abombe...@gmail.com wrote: Hello, When using recover the parent_id fields for root entries are empty. Is there a way to set a default value like -1 as parent_id for root items? why Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en