[eluser]kuroyakedo[/eluser]
Hello, I'm new in the forum.
I have a problem like this, but I use de simple way to define relationchips.
Here is some code:
model Campus:
Code:
Class Campus extends Datamapper {
var $table='campi';
var $has_many=array('boleto');
function __construct() {
parent::__construct();
}
}
And boleto:
Code:
class Boleto extends Datamapper {
var $table='boletos';
var $has_one=array('campus');
function __construct(){
parent::__construct();
}
}
I have been working with these tables 5 months, even have the relation table:
| id | boleto_id | campus_id |
Everything was ok, but recently, every time I need to make something that includes that relation I got this error message:
Quote:DataMapper Error: 'boleto' is not a valid parent relationship for Campus. Are your relationships configured correctly?
Tables:
"boletos":
| id | folio |
"campi":
| id | nombre_campus |
"boletos_campi":
| id | boleto_id | campus_id |
I'm trying with this code:
Code:
$b = new Boleto();
$b->where('id',20114)->get();
$b->campus->get();