[FLOW3-general] Persistance\Query

Georg Ortner go at simplaweb.at
Mon Feb 15 20:50:17 CET 2010


I'm implementing a tree of categories. My category model got a property 
called parent which can be a parent category or NULL. Now I want to 
create a query to search for all categories which have no parent (The 
root categories).

$query->matching($query->equals('parent'), NULL)->execute();

But this doesn't work. Isn't this a proper way to ask if parent is a 
Category Object or NULL?

When I call $category->getParent() I'm getting NULL on the same Object 
which hasn't met the criteria for the above query...

Do I really have to introduce another property to store the information 
if this is a root category or not? I'm sure there is a better solution 
I'm just too much of a user to find it on my own right now.

thanks


More information about the FLOW3-general mailing list