[eluser]OverZealous[/eluser] @Buso
Search for arrays in the manual. The first result is your answer. ;-)
NachoF
No, your example won't work, because $phase and $state would need to be saved separately. All new objects must be saved before the relationships are saved. After that, it doesn't matter what order things are saved in (it's the same number of queries).
If you are saving multiple objects and/or multiple relationships, you should wrap everything in a transaction. (Auto transactions will not help.)