Model/Behavior/RevisionBehavior.php
protected function _init(Model $Model, $page, $limit) {
		$habtm = array();
		$allHabtm = $Model->getAssociated('hasAndBelongsToMany');
		foreach ($allHabtm as $assocAlias) {
			if (isset($Model->ShadowModel->_schema[$assocAlias])) {
				$habtm[] = $assocAlias;
			}
		}
		$all = $Model->find('all', array(
			'limit' => $limit,
			'page' => $page,
			'contain' => $habtm));
		$versionCreated = date('Y-m-d H:i:s');
		foreach ($all as $data) {
			$Model->ShadowModel->create($data);
			$Model->ShadowModel->set('version_created', $versionCreated);
			$Model->ShadowModel->save();
		}
	}
protected function _init(Model $Model, $page, $limit) {
		$habtm = array();
		$allHabtm = $Model->getAssociated('hasAndBelongsToMany');
		foreach ($allHabtm as $assocAlias) {
			if (isset($Model->ShadowModel->_schema[$assocAlias])) {
				$habtm[] = $assocAlias;
			}
		}
		$all = $Model->find('all', array(
			'limit' => $limit,
			'page' => $page,
			'contain' => $habtm));
		$versionCreated = date('Y-m-d H:i:s');
		foreach ($all as $data) {
			$Model->ShadowModel->create($data);
			$Model->ShadowModel->set('version_created', $versionCreated);
			$Model->ShadowModel->save();
		}
	}
protected function _init ( Model $ Model , $ page , $ limit ) { $ habtm = array ( ) ; $ allHabtm = $ Model -> getAssociated ( 'hasAndBelongsToMany' ) ; foreach ( $ allHabtm as $ assocAlias ) { if ( isset ( $ Model -> ShadowModel -> _schema [ $ assocAlias ] ) ) { $ habtm [ ] = $ assocAlias ; } } $ all = $ Model -> find ( 'all' , array ( 'limit' => $ limit , 'page' => $ page , 'contain' => $ habtm ) ) ; $ versionCreated = date ( 'Y-m-d H:i:s' ) ; foreach ( $ all as $ data ) { $ Model -> ShadowModel -> create ( $ data ) ; $ Model -> ShadowModel -> set ( 'version_created' , $ versionCreated ) ; $ Model -> ShadowModel -> save ( ) ; } }
Saves revisions for rows matching page and limit given

@param object $Model
@param int $page
@param int $limit
@return void
Saves revisions for rows matching page and limit given