Welcome Guest, Not a member yet? Register   Sign In
DataMapper - Counting related items
#4

[eluser]NeilyM[/eluser]
Ah - it's the wrong way round!

This seems to work:

$continent_id = 1;
$person = new Person;
$count = $person->where_related('country/continent', 'id', $continent_id)->count();

Cheers,

NeilyM


Messages In This Thread
DataMapper - Counting related items - by El Forum - 03-21-2011, 11:58 AM
DataMapper - Counting related items - by El Forum - 03-21-2011, 05:03 PM
DataMapper - Counting related items - by El Forum - 03-21-2011, 06:06 PM
DataMapper - Counting related items - by El Forum - 03-21-2011, 06:18 PM
DataMapper - Counting related items - by El Forum - 03-22-2011, 01:37 AM
DataMapper - Counting related items - by El Forum - 03-22-2011, 03:53 AM
DataMapper - Counting related items - by El Forum - 03-22-2011, 05:45 AM
DataMapper - Counting related items - by El Forum - 03-24-2011, 07:50 AM
DataMapper - Counting related items - by El Forum - 11-22-2012, 12:22 PM
DataMapper - Counting related items - by El Forum - 11-22-2012, 02:03 PM
DataMapper - Counting related items - by El Forum - 11-23-2012, 01:27 AM
DataMapper - Counting related items - by El Forum - 11-23-2012, 03:39 AM
DataMapper - Counting related items - by El Forum - 11-23-2012, 07:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB