[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]naren_nag[/eluser]
Hi, What you're trying to do here is create a data structure called a nested set. Why don't you check this out: http://dev.mysql.com/tech-resources/arti...-data.html That's how you'd set it up in the classic manner. Also read http://overzealous.com/dmz/pages/advancedrelations.html to understand self referencing relationships in DMZ. Now as far as your code above is concerned: correct me if I'm wrong - Code: class Category extends Datamapper { Now you seem to be making a fundamental mistake: Code: $cat->get_by_id(0); Here's how I'd do it Code: $parentCategoryObject = new Category(); Hope this helps, naren |
Welcome Guest, Not a member yet? Register Sign In |