Model/Behavior/RevisionBehavior.php
public function previous(Model $Model, $options = array()) {
		if (!$Model->id) {
			trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING);
			return array();
		}
		if (!$Model->ShadowModel) {
			trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING);
			return array();
		}
		$options['limit'] = 1;
		$options['page'] = 2;
		if (isset($options['conditions'])) {
			$options['conditions'] = array_merge($options['conditions'], array($Model->primaryKey => $Model->id));
		} else {
			$options['conditions'] = array($Model->primaryKey => $Model->id);
		}
		$revisions = $Model->ShadowModel->find('all', $options);
		if (!$revisions) {
			return array();
		}
		return $revisions[0];
	}
public function previous(Model $Model, $options = array()) {
		if (!$Model->id) {
			trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING);
			return array();
		}
		if (!$Model->ShadowModel) {
			trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING);
			return array();
		}
		$options['limit'] = 1;
		$options['page'] = 2;
		if (isset($options['conditions'])) {
			$options['conditions'] = array_merge($options['conditions'], array($Model->primaryKey => $Model->id));
		} else {
			$options['conditions'] = array($Model->primaryKey => $Model->id);
		}
		$revisions = $Model->ShadowModel->find('all', $options);
		if (!$revisions) {
			return array();
		}
		return $revisions[0];
	}
public function previous ( Model $ Model , $ options = array ( ) ) { if ( ! $ Model -> id ) { trigger_error ( 'RevisionBehavior: Model::id must be set' , E_USER_WARNING ) ; return array ( ) ; } if ( ! $ Model -> ShadowModel ) { trigger_error ( 'RevisionBehavior: ShadowModel doesnt exist.' , E_USER_WARNING ) ; return array ( ) ; } $ options [ 'limit' ] = 1 ; $ options [ 'page' ] = 2 ; if ( isset ( $ options [ 'conditions' ] ) ) { $ options [ 'conditions' ] = array_merge ( $ options [ 'conditions' ] , array ( $ Model -> primaryKey => $ Model -> id ) ) ; } else { $ options [ 'conditions' ] = array ( $ Model -> primaryKey => $ Model -> id ) ; } $ revisions = $ Model -> ShadowModel -> find ( 'all' , $ options ) ; if ( ! $ revisions ) { return array ( ) ; } return $ revisions [ 0 ] ; }
Find the second newest revisions, including the current one.

@example $this->Post->id = 6; $undoRevision = $this->Post->previous();
@param object $Model
@param array $options
@return array
Find the second newest revisions including the current one .