A Di Tue Mar 12 18:20:21 -0400 2013

Subject: Save / Persist model with relationship

Hi,
wanted to know how to save a model and it's relationships ?

Ex:

$u = User:find(1);

$post = new Post();
$post->title = "A title";

// something like this ?
$post->user->insert($u);
$post->save();

// instead of the manual
$post->user_id = $u->id;

// or perhaps something like below
$user->post[] = $post;
$user->save();

anyone knows if it exists in the doc or if there's a fork ?