yiisoft/yii2 — pull request #215 by creocoder (2013-05-10 14:27:01+00:00)
Title: [WIP] ActiveRecord with relations saving feature

This allows validate customers together with their orders and country:

```
$customer = new Customer;
$customer->name = 'Qiang Xue';
$customer->populateRelation('orders', array(
Order::create(array('type' => 'strong coffee')),
Order::create(array('type' => 'tasty pizza')),
));
$customer->populateRelation('country', array(
Country::create(array('name' => 'United States')),
));
$customer->with('orders', 'country')->validate();
```

This alllows save customers together with their orders and country:

```
$customer = new Customer;
$customer->name = 'Qiang Xue';
$customer->populateRelation('orders', array(
Order::create(array('type' => 'strong coffee')),
Order::create(array('type' => 'tasty pizza')),
));
$customer->populateRelation('country', array(
Country::create(array('name' => 'United States')),
));
$customer->with('orders', 'country')->save();
```

Need feedback for this feature.