[eluser]msteudel[/eluser]
I have the following tables:
Code:
Scenarios
id | scenario_name | etc.
Locations
id | location_name | etc.
Sites
id | site_name | etc.
Types
id | type_name | etc.
scenarios_sites
id | scenario_id | location_id | site_id | type_Id | created_on | updated_on
I'm trying to figure out how to save this sort of relationship ...
I tried something like this:
Code:
$site = new Site();
$site->where( 'id', 3)->get();
$loc = new Location();
$loc->where( 'id', 4 )->get();
$type = new Type();
$type->where( 'id', 2 )->get();
$scen = new Scenario();
$scen->scenario_name = 'Test';
$scen->save( array( $site, $loc, $type ) );
I get this error:
Code:
Unable to relate scenario with location.
Can anyone point me int he right direction.
TIA