All pastes #359631 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-16 23:17 UTC
rendered paste body
how I add a new element with a field link with another table with one-two-one

I have test : 

$obj = new $Table();
$obj->name = "toto";
$obj->langue->code = "EN";
$obj->save();

when I do that I insert a new line in the langue table
and I would like to take the obj take the id of langue and set it for my new element

I must call new Langue() for get it ?