Browse Source

update behaviors to be estrict compliant regarding cake2.4

euromark 12 years ago
parent
commit
0367f72a3a

+ 2 - 2
Model/Behavior/BitmaskedBehavior.php

@@ -98,7 +98,7 @@ class BitmaskedBehavior extends ModelBehavior {
 	/**
 	 * @return boolean Success
 	 */
-	public function beforeValidate(Model $Model) {
+	public function beforeValidate(Model $Model, $options = array()) {
 		if ($this->settings[$Model->alias]['before'] !== 'validate') {
 			return true;
 		}
@@ -109,7 +109,7 @@ class BitmaskedBehavior extends ModelBehavior {
 	/**
 	 * @return boolean Success
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		if ($this->settings[$Model->alias]['before'] !== 'save') {
 			return true;
 		}

+ 2 - 2
Model/Behavior/CaptchaBehavior.php

@@ -51,8 +51,8 @@ class CaptchaBehavior extends ModelBehavior {
 		}
 	}
 
-	public function beforeValidate(Model $Model) {
-		parent::beforeValidate($Model);
+	public function beforeValidate(Model $Model, $options = array()) {
+		parent::beforeValidate($Model, $options);
 		if (!empty($this->Model->whitelist)) {
 			$this->Model->whitelist = array_merge($Model->whitelist, $this->fields());
 		}

+ 4 - 4
Model/Behavior/ConfirmableBehavior.php

@@ -34,8 +34,8 @@ class ConfirmableBehavior extends ModelBehavior {
 	 * @param Model $Model
 	 * @return bool Success
 	 */
-	public function beforeValidate(Model $Model) {
-		$return = parent::beforeValidate($Model);
+	public function beforeValidate(Model $Model, $options = array()) {
+		$return = parent::beforeValidate($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'validate') {
 			# we dont want to return the value, because other fields might then not be validated
@@ -52,8 +52,8 @@ class ConfirmableBehavior extends ModelBehavior {
 	 * @param Model $Model
 	 * @return mixed
 	 */
-	public function beforeSave(Model $Model) {
-		$return = parent::beforeSave($Model);
+	public function beforeSave(Model $Model, $options = array()) {
+		$return = parent::beforeSave($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'save') {
 			return $this->confirm($Model, $return);

+ 2 - 2
Model/Behavior/DecimalInputBehavior.php

@@ -97,7 +97,7 @@ class DecimalInputBehavior extends ModelBehavior {
 		$this->config[$Model->alias]['fields'] = array_merge($this->config[$Model->alias]['fields'], $numberFields);
 	}
 
-	public function beforeValidate(Model $Model) {
+	public function beforeValidate(Model $Model, $options = array()) {
 		if ($this->config[$Model->alias]['before'] !== 'validate') {
 			return true;
 		}
@@ -106,7 +106,7 @@ class DecimalInputBehavior extends ModelBehavior {
 		return true;
 	}
 
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		if ($this->config[$Model->alias]['before'] !== 'save') {
 			return true;
 		}

+ 4 - 4
Model/Behavior/GeocoderBehavior.php

@@ -55,8 +55,8 @@ class GeocoderBehavior extends ModelBehavior {
 		$this->settings[$Model->alias] = array_merge($this->settings[$Model->alias], is_array($settings) ? $settings : array());
 	}
 
-	public function beforeValidate(Model $Model) {
-		parent::beforeValidate($Model);
+	public function beforeValidate(Model $Model, $options = array()) {
+		parent::beforeValidate($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'validate') {
 			return $this->geocode($Model);
@@ -65,8 +65,8 @@ class GeocoderBehavior extends ModelBehavior {
 		return true;
 	}
 
-	public function beforeSave(Model $Model) {
-		parent::beforeSave($Model);
+	public function beforeSave(Model $Model, $options = array()) {
+		parent::beforeSave($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'save') {
 			return $this->geocode($Model);

+ 1 - 1
Model/Behavior/HazardableBehavior.php

@@ -52,7 +52,7 @@ class HazardableBehavior extends ModelBehavior {
 	 * Note: Remember to disable validation as you want to insert those strings just for
 	 * testing purposes.
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		$fields = $this->_fields($Model);
 		foreach ($fields as $field) {
 			$length = 0;

+ 1 - 1
Model/Behavior/JsonableBehavior.php

@@ -111,7 +111,7 @@ class JsonableBehavior extends ModelBehavior {
 	 * @param object $Model
 	 * @return boolean Success
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		$data = $Model->data[$Model->alias];
 		$usedFields = $this->settings[$Model->alias]['fields'];
 		$mappedFields = $this->settings[$Model->alias]['map'];

+ 2 - 2
Model/Behavior/LogableBehavior.php

@@ -377,7 +377,7 @@ class LogableBehavior extends ModelBehavior {
 		$this->_saveLog($Model, $logData);
 	}
 
-	public function beforeValidate(Model $Model) {
+	public function beforeValidate(Model $Model, $options = array()) {
 		if (!$this->settings[$Model->alias]['enabled'] || $this->settings[$Model->alias]['on'] !== 'validate') {
 			return true;
 		}
@@ -385,7 +385,7 @@ class LogableBehavior extends ModelBehavior {
 		return true;
 	}
 
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		if (!$this->settings[$Model->alias]['enabled'] || $this->settings[$Model->alias]['on'] !== 'save') {
 			return true;
 		}

+ 4 - 4
Model/Behavior/MasterPasswordBehavior.php

@@ -55,8 +55,8 @@ class MasterPasswordBehavior extends ModelBehavior {
 		}
 	}
 
-	public function beforeValidate(Model $Model) {
-		$return = parent::beforeValidate($Model);
+	public function beforeValidate(Model $Model, $options = array()) {
+		$return = parent::beforeValidate($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'validate') {
 			# we dont want to return the value, because other fields might then not be validated
@@ -67,8 +67,8 @@ class MasterPasswordBehavior extends ModelBehavior {
 		return $return;
 	}
 
-	public function beforeSave(Model $Model) {
-		$return = parent::beforeSave($Model);
+	public function beforeSave(Model $Model, $options = array()) {
+		$return = parent::beforeSave($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'save') {
 			return $this->confirm($Model, $return);

+ 2 - 2
Model/Behavior/NumberFormatBehavior.php

@@ -97,7 +97,7 @@ class NumberFormatBehavior extends ModelBehavior {
 		$this->settings[$Model->alias]['fields'] = array_merge($this->settings[$Model->alias]['fields'], $numberFields);
 	}
 
-	public function beforeValidate(Model $Model) {
+	public function beforeValidate(Model $Model, $options = array()) {
 		if ($this->settings[$Model->alias]['before'] !== 'validate') {
 			return true;
 		}
@@ -106,7 +106,7 @@ class NumberFormatBehavior extends ModelBehavior {
 		return true;
 	}
 
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		if ($this->settings[$Model->alias]['before'] !== 'save') {
 			return true;
 		}

+ 2 - 2
Model/Behavior/PasswordableBehavior.php

@@ -302,7 +302,7 @@ class PasswordableBehavior extends ModelBehavior {
 	 * @return bool Success
 	 * 2011-07-22 ms
 	 */
-	public function beforeValidate(Model $Model) {
+	public function beforeValidate(Model $Model, $options = array()) {
 		$formField = $this->settings[$Model->alias]['formField'];
 		$formFieldRepeat = $this->settings[$Model->alias]['formFieldRepeat'];
 		$formFieldCurrent = $this->settings[$Model->alias]['formFieldCurrent'];
@@ -358,7 +358,7 @@ class PasswordableBehavior extends ModelBehavior {
 	 * @return bool Success
 	 * 2011-07-22 ms
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		$formField = $this->settings[$Model->alias]['formField'];
 		$field = $this->settings[$Model->alias]['field'];
 		$type = $this->settings[$Model->alias]['hashType'];

+ 1 - 1
Model/Behavior/RevisionBehavior.php

@@ -909,7 +909,7 @@ class RevisionBehavior extends ModelBehavior {
 	 * @param object $Model
 	 * @return boolean
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		if ($this->settings[$Model->alias]['auto'] === false) {
 			return true;
 		}

+ 2 - 2
Model/Behavior/SluggedBehavior.php

@@ -126,7 +126,7 @@ class SluggedBehavior extends ModelBehavior {
 	 * @param Model $Model
 	 * @return void
 	 */
-	public function beforeValidate(Model $Model) {
+	public function beforeValidate(Model $Model, $options = array()) {
 		extract($this->settings[$Model->alias]);
 		if ($run !== 'beforeValidate') {
 			return;
@@ -145,7 +145,7 @@ class SluggedBehavior extends ModelBehavior {
 	 * @param Model $Model
 	 * @return void
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		extract($this->settings[$Model->alias]);
 		if ($run !== 'beforeSave') {
 			return;

+ 4 - 4
Model/Behavior/TypographicBehavior.php

@@ -114,8 +114,8 @@ class TypographicBehavior extends ModelBehavior {
 	 * @param Model $Model
 	 * @return boolean Success
 	 */
-	public function beforeValidate(Model $Model) {
-		parent::beforeValidate($Model);
+	public function beforeValidate(Model $Model, $options = array()) {
+		parent::beforeValidate($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'validate') {
 			$this->process($Model);
@@ -130,8 +130,8 @@ class TypographicBehavior extends ModelBehavior {
 	 * @param Model $Model
 	 * @return boolean Success
 	 */
-	public function beforeSave(Model $Model) {
-		parent::beforeSave($Model);
+	public function beforeSave(Model $Model, $options = array()) {
+		parent::beforeSave($Model, $options);
 
 		if ($this->settings[$Model->alias]['before'] === 'save') {
 			$this->process($Model);

+ 1 - 1
Model/Behavior/WhoDidItBehavior.php

@@ -97,7 +97,7 @@ class WhoDidItBehavior extends ModelBehavior {
 	 * @param Model $Model The model using this behavior.
 	 * @return boolean True if the operation should continue, false if it should abort.
 	 */
-	public function beforeSave(Model $Model) {
+	public function beforeSave(Model $Model, $options = array()) {
 		if ($this->settings[$Model->alias]['has_created_by'] || $this->settings[$Model->alias]['has_modified_by']) {
 			$AuthSession = $this->settings[$Model->alias]['auth_session'];
 			$UserSession = $this->settings[$Model->alias]['user_model'];