Welcome Guest, Not a member yet? Register   Sign In
(Datamapper) Where_join_field->Error 1054
#5

[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();


Messages In This Thread
(Datamapper) Where_join_field->Error 1054 - by El Forum - 04-07-2011, 02:39 PM
(Datamapper) Where_join_field->Error 1054 - by El Forum - 04-07-2011, 04:34 PM
(Datamapper) Where_join_field->Error 1054 - by El Forum - 04-08-2011, 12:59 AM
(Datamapper) Where_join_field->Error 1054 - by El Forum - 04-08-2011, 01:37 AM
(Datamapper) Where_join_field->Error 1054 - by El Forum - 08-07-2011, 09:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB