I'm starting with Datamapper and having some errors. I thought if I create an object, a related object and then I save the relationship, both the objects were saves as well.
$u = new User();
$u->where('id', $id)->get();
$p = new User_profile();
$p->name = 'xx';
$u->save($p);
Actually if I do like this, the profile is not saved. And of course not the relationship. If I do something like this:
$u = new User();
$u->where('id', $id)->get();
$p = new User_profile();
$p->save();
$p->name = 'xx';
$u->save($p);
both are saved but the profile is completly empty. None of the parameters are saved but the id and the Datamapper defaults (created and updated)
Is this behavior correct or am I missing something?
Thanks!