Model/Behavior/RevisionBehavior.php
public function newest(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();
		}
		if (isset($options['conditions'])) {
			$options['conditions'] = array_merge($options['conditions'], array($Model->alias . '.' . $Model->primaryKey => $Model->id));
		} else {
			$options['conditions'] = array($Model->alias . '.' . $Model->primaryKey => $Model->id);
		}

		return $Model->ShadowModel->find('first', $options);
	}
public function newest(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();
		}
		if (isset($options['conditions'])) {
			$options['conditions'] = array_merge($options['conditions'], array($Model->alias . '.' . $Model->primaryKey => $Model->id));
		} else {
			$options['conditions'] = array($Model->alias . '.' . $Model->primaryKey => $Model->id);
		}

		return $Model->ShadowModel->find('first', $options);
	}
public function newest ( 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 ( ) ; } if ( isset ( $ options [ 'conditions' ] ) ) { $ options [ 'conditions' ] = array_merge ( $ options [ 'conditions' ] , array ( $ Model -> alias . '.' . $ Model -> primaryKey => $ Model -> id ) ) ; } else { $ options [ 'conditions' ] = array ( $ Model -> alias . '.' . $ Model -> primaryKey => $ Model -> id ) ; } return $ Model -> ShadowModel -> find ( 'first' , $ options ) ; }
Finds the newest revision, including the current one.
Use with caution, the live model may be different depending on the usage
of ignore fields.

@example $this->Post->id = 6; $newestRevision = $this->Post->newest();
@param object $Model
@param array $options
@return array
Finds the newest revision including the current one . Use with caution the live model may be different depending on the usage of ignore fields .