[eluser]swatkins[/eluser]
[quote author="liebgott" date="1302263964"]Now i'm getting this
Code:
An Error Was Encountered
Unable to relate student with student.
[/quote]
I'm sure you've figured this out, but I'll post here for others having the same problem. Your code:
Code:
$numero->select('course.*')->student->where_join_field('student', 'pagado' , FALSE)->get();
is trying to relate student -> student because of the chainability of datamapper. When you call 'where_join_field', you're actually calling that on 'student' because that's the last object you've referenced in the chain when you call 'where_join_field'. Therefore, you need to specify the relationship back to $numero in 'where_join_field'.
Code:
$numero->select('course.*')->student->where_join_field($numero, 'pagado' , FALSE)->get();