Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Datamapper - Count related items
#1

[eluser]drakeonfire[/eluser]
Hello,

I'm trying to display all categories from my database, which I can do (like so):
Code:
$cats= new Category();
$data['cats'] = $cats->get_iterated();
However, these categories are related to products, and I want to know how I can count how many products are in each category (without having to loop through them to do the query).

I've read through the manual and done searching online, however, I can't find anything that is doing more than one object (as they all seem to supply it with an ID first).

Any ideas?

Thank you.


Messages In This Thread
[SOLVED] Datamapper - Count related items - by El Forum - 02-14-2012, 12:27 PM
[SOLVED] Datamapper - Count related items - by El Forum - 02-14-2012, 02:24 PM
[SOLVED] Datamapper - Count related items - by El Forum - 02-14-2012, 02:58 PM
[SOLVED] Datamapper - Count related items - by El Forum - 02-14-2012, 02:59 PM
[SOLVED] Datamapper - Count related items - by El Forum - 02-14-2012, 03:54 PM
[SOLVED] Datamapper - Count related items - by El Forum - 02-14-2012, 05:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB