Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected afterSave parameters, fixed notices when saving models with no HABTM associations #13

Merged
merged 2 commits into from
Oct 14, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Model/Behavior/HabtmCounterCacheBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ protected function _setOldHabtmIds(&$model) {
* @param boolean $created
* @return boolean Always true
*/
public function afterSave(Model $model, $created) {
public function afterSave(Model $model, $created, $options = array()) {

$this->_setNewHabtmIds($model);

Expand All @@ -276,7 +276,7 @@ protected function _setNewHabtmIds($model) {
// are not changing, but the scope of the record may be, so we still need
// need to leave the old ones in the _habtmIds property and re-calculate
// any counts.
if (!isset($model->data[$habtmAlias][$habtmAlias])) {
if (empty($model->data[$habtmAlias][$habtmAlias])) {
continue;
}

Expand Down