Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1165 from mariansollmann/issue-1165
Browse files Browse the repository at this point in the history
Add _changeContainingCacheables on model abstract
  • Loading branch information
Marian Sollmann committed Apr 28, 2014
2 parents 4510962 + 11f5bdc commit 3ea5909
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions library/CM/Model/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ public function commit() {
$cache->save($this->getType(), $this->getIdRaw(), $this->_getData());
}
$this->_onChange();
foreach ($this->_getContainingCacheables() as $cacheable) {
$cacheable->_change();
}
$this->_changeContainingCacheables();
$this->_onCreate();
}
$this->_autoCommit = true;
Expand Down Expand Up @@ -386,6 +384,12 @@ protected function _getContainingCacheables() {
return array();
}

protected function _changeContainingCacheables(){
foreach ($this->_getContainingCacheables() as $cacheable) {
$cacheable->_change();
}
}

/**
* @return CM_Model_Schema_Definition
*/
Expand Down Expand Up @@ -443,9 +447,7 @@ final public static function createStatic(array $data = null) {
}
$model = static::_createStatic($data);
$model->_onChange();
foreach ($model->_getContainingCacheables() as $cacheable) {
$cacheable->_change();
}
$model->_changeContainingCacheables();
$model->_onCreate();
return $model;
}
Expand Down

0 comments on commit 3ea5909

Please sign in to comment.