Model/Behavior/RevisionBehavior.php
public function beforeSave(Model $Model, $options = array()) {
		if ($this->settings[$Model->alias]['auto'] === false) {
			return true;
		}
		if (!$Model->ShadowModel) {
			return true;
		}
		$Model->ShadowModel->create();
		if (!isset($Model->data[$Model->alias][$Model->primaryKey]) && !$Model->id) {
			return true;
		}

		$habtm = array();
		foreach ($Model->getAssociated('hasAndBelongsToMany') as $assocAlias) {
			if (isset($Model->ShadowModel->_schema[$assocAlias])) {
				$habtm[] = $assocAlias;
			}
		}
		$this->_oldData[$Model->alias] = $Model->find('first', array(
				'contain' => $habtm, 'conditions' => array($Model->alias . '.' . $Model->primaryKey => $Model->id)));

		return true;
	}
public function beforeSave(Model $Model, $options = array()) {
		if ($this->settings[$Model->alias]['auto'] === false) {
			return true;
		}
		if (!$Model->ShadowModel) {
			return true;
		}
		$Model->ShadowModel->create();
		if (!isset($Model->data[$Model->alias][$Model->primaryKey]) && !$Model->id) {
			return true;
		}

		$habtm = array();
		foreach ($Model->getAssociated('hasAndBelongsToMany') as $assocAlias) {
			if (isset($Model->ShadowModel->_schema[$assocAlias])) {
				$habtm[] = $assocAlias;
			}
		}
		$this->_oldData[$Model->alias] = $Model->find('first', array(
				'contain' => $habtm, 'conditions' => array($Model->alias . '.' . $Model->primaryKey => $Model->id)));

		return true;
	}
public function beforeSave ( Model $ Model , $ options = array ( ) ) { if ( $ this -> settings [ $ Model -> alias ] [ 'auto' ] === false ) { return true ; } if ( ! $ Model -> ShadowModel ) { return true ; } $ Model -> ShadowModel -> create ( ) ; if ( ! isset ( $ Model -> data [ $ Model -> alias ] [ $ Model -> primaryKey ] ) && ! $ Model -> id ) { return true ; } $ habtm = array ( ) ; foreach ( $ Model -> getAssociated ( 'hasAndBelongsToMany' ) as $ assocAlias ) { if ( isset ( $ Model -> ShadowModel -> _schema [ $ assocAlias ] ) ) { $ habtm [ ] = $ assocAlias ; } } $ this -> _oldData [ $ Model -> alias ] = $ Model -> find ( 'first' , array ( 'contain' => $ habtm , 'conditions' => array ( $ Model -> alias . '.' . $ Model -> primaryKey => $ Model -> id ) ) ) ; return true ; }
Revision uses the beforeSave callback to remember the old data for comparison in afterSave

@param object $Model
@return bool Success
Revision uses the beforeSave callback to remember the old data for comparison in afterSave