DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]Spir[/eluser]
[quote author="j0nxiest" date="1275317111"]I didn't quite get from the documentation how to work with related items with the from_array method. I tried to do like this: The form: Code: <?php The handler: Code: $user = new User(); But it complaints that the usergroup relation is not set, what am i doing wrong? The usergroup var is POSTed correctly.[/quote] I'm not sure since I never used this and I discover this functionnality with your post but I think your solution is in the second parameter of the from_array function → from_array($data, $fields, $save) The field usergroup should be called usergroup_id? Why adding this hidden value if you won't update it? http://www.overzealous.com/dmz/pages/ext...array.html Also you could have specified TRUE then no need to call save(). |
Welcome Guest, Not a member yet? Register Sign In |