euromark 13 years ago
parent
commit
6a4101579b

+ 0 - 2
Model/Behavior/ConfirmableBehavior.php

@@ -20,8 +20,6 @@ class ConfirmableBehavior extends ModelBehavior {
 		'before' => 'validate',
 	);
 
-	public $settings = array();
-
 	public function setup(Model $Model, $settings = array()) {
 		if (!isset($this->settings[$Model->alias])) {
 			$this->settings[$Model->alias] = $this->_defaults;

+ 1 - 2
Model/Behavior/JsonableBehavior.php

@@ -24,14 +24,13 @@ App::uses('ModelBehavior', 'Model');
  * - can be used to create dynamic forms (and tables)
  *
  * Also automatically cleans lists and works with custom separators etc
- * 
+ *
  * @link http://www.dereuromark.de/2011/07/05/introducing-two-cakephp-behaviors/
  * 2011-07-04 ms
  */
 class JsonableBehavior extends ModelBehavior {
 
 	public $decoded = null;
-	public $settings = array();
 
 	/**
 	 * //TODO: json input/ouput directly, clean

+ 0 - 7
Model/Behavior/KeyValueBehavior.php

@@ -13,13 +13,6 @@ App::uses('ModelBehavior', 'Model');
 class KeyValueBehavior extends ModelBehavior {
 
 	/**
-	 * Settings
-	 *
-	 * @var mixed
-	 */
-	public $settings = array();
-
-	/**
 	 * Storage model for all key value pairs
 	 */
 	public $KeyValue = null;

+ 2 - 7
Model/Behavior/PasswordableBehavior.php

@@ -42,14 +42,9 @@ if (!defined('PWD_MAX_LENGTH')) {
 class PasswordableBehavior extends ModelBehavior {
 
 	/**
-	 * @access public
-	 */
-	public $settings = array();
-
-	/**
 	 * @access protected
 	 */
-	protected $_defaultSettings = array(
+	protected $_defaults = array(
 		'field' => 'password',
 		'confirm' => true, # set to false if in admin view and no confirmation (pwd_repeat) is required
 		'allowEmpty' => false, # if password must be provided or be changed (set to true for update sites)
@@ -204,7 +199,7 @@ class PasswordableBehavior extends ModelBehavior {
 	 * 2011-08-24 ms
 	 */
 	public function setup(Model $Model, $config = array()) {
-		$defaults = $this->_defaultSettings;
+		$defaults = $this->_defaults;
 		if ($configureDefaults = Configure::read('Passwordable')) {
 			$defaults = Set::merge($defaults, $configureDefaults);
 		}

+ 3 - 0
Model/Behavior/ResetBehavior.php

@@ -2,6 +2,9 @@
 App::uses('ModelBehavior', 'Model');
 
 /**
+ * Allows the model to reset all records as batch command.
+ * This way any slugging, geocoding or other beforeValidate, beforeSave, ... callbacks
+ * can be retriggered for them.
  *
  * @author Mark Scherer
  * @license MIT

+ 6 - 13
Model/Behavior/RevisionBehavior.php

@@ -108,32 +108,25 @@ App::uses('ModelBehavior', 'Model');
 class RevisionBehavior extends ModelBehavior {
 
 	/**
-	 * Behavior settings
-	 *
-	 * @access public
-	 * @var array
-	 */
-	public $settings = array();
-	/**
 	 * Shadow table prefix
 	 * Only change this value if it causes table name crashes
 	 *
-	 * @access private
 	 * @var string
 	 */
-	protected $revision_suffix = '_revs';
+	public $revision_suffix = '_revs';
+
 	/**
 	 * Defaul setting values
 	 *
-	 * @access private
 	 * @var array
 	 */
-	protected $defaults = array(
+	protected $_defaults = array(
 		'limit' => false,
 		'auto' => true,
 		'ignore' => array(),
 		'useDbConfig' => null,
 		'model' => null);
+
 	/**
 	 * Old data, used to detect changes
 	 *
@@ -149,9 +142,9 @@ class RevisionBehavior extends ModelBehavior {
 	 */
 	public function setup(Model $Model, $config = array()) {
 		if (!empty($config)) {
-			$this->settings[$Model->alias] = array_merge($this->defaults, $config);
+			$this->settings[$Model->alias] = array_merge($this->_defaults, $config);
 		} else {
-			$this->settings[$Model->alias] = $this->defaults;
+			$this->settings[$Model->alias] = $this->_defaults;
 		}
 		$this->createShadowModel($Model);
 		$Model->Behaviors->load('Containable');