cakephp/cakephp — pull request #2423 by lorenzo (2013-12-03 22:09:51+00:00)
Title: 3.0 save associated entities

This PR includes all the logic for saving associated records. Some of the highlights:

* `Table::save()` will save associations by default
* It is possible to whitelist the associations that will be inspected
* Only entities stored in a dirty property of the source object will be saved
* Saving is delegated to association classes
* BelongsToMany will *NOT* destroy existing links only update or create new ones

Things that will be addressed in future PRs:

* A "Set" saving strategy for HasMany: Delete all in target association before saving records
* Dedicated methods for handling BelongsToMany: `$belongsToMany->link($article, [$tag1, $tag2])` `$belongsToMany->unlink($article, [$tag1, $tag2])` and `$belongsToMany->replace($article, [$tag1, $tag2])`;