Open bionicmaster opened 14 years ago
Not sure what you mean. Set takes an array of key => val
params and sets them to whatever the val
param was. For example, if address was a relationship in an "addresses" field:
$user->set(array(
'primary_address' => $primary_address_jelly_record,
'secondar_address' => $another_record,
'email' => 'john@doe.com'
));
I don't see any problem with this.
I have an object (extracted from another tables) $object->id, $object->name; when I try $anothertable->set($object) there's an error: This is not an array, then I need to do $anothertable->set((array) $object) to apply.
When I try to set an object instead of an array, system generates me error, I need to cast my object as array to insert into my DB