diff --git a/library/CM/Model/Abstract.php b/library/CM/Model/Abstract.php index bdaa91a1b..144931e70 100644 --- a/library/CM/Model/Abstract.php +++ b/library/CM/Model/Abstract.php @@ -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; @@ -386,6 +384,12 @@ protected function _getContainingCacheables() { return array(); } + protected function _changeContainingCacheables(){ + foreach ($this->_getContainingCacheables() as $cacheable) { + $cacheable->_change(); + } + } + /** * @return CM_Model_Schema_Definition */ @@ -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; }