Skip to content
Permalink
Browse files

Keeping BC on short syntax for Acl and Tree behavior.

  • Loading branch information...
renan committed Oct 16, 2011
1 parent 3a04bb4 commit 229bf8e9848b810ee386a57b94f421aa30d7f45d
@@ -43,7 +43,11 @@ class AclBehavior extends ModelBehavior {
* @return void
*/
public function setup($model, $config = array()) {
$this->settings[$model->name] = array_merge(array('type' => 'controlled'), (array)$config);
if (isset($config[0])) {
$config['type'] = $config[0];
unset($config[0]);
}
$this->settings[$model->name] = array_merge(array('type' => 'controlled'), $config);
$this->settings[$model->name]['type'] = strtolower($this->settings[$model->name]['type']);
$types = $this->_typeMaps[$this->settings[$model->name]['type']];
@@ -55,6 +55,10 @@ class TreeBehavior extends ModelBehavior {
* @return void
*/
public function setup($Model, $config = array()) {
if (isset($config[0])) {
$config['type'] = $config[0];
unset($config[0]);
}
$settings = array_merge($this->_defaults, $config);
if (in_array($settings['scope'], $Model->getAssociated('belongsTo'))) {
@@ -53,7 +53,7 @@ class AclPerson extends CakeTestModel {
*
* @var array
*/
public $actsAs = array('Acl' => array('type' => 'both'));
public $actsAs = array('Acl' => 'both');
/**
* belongsTo property

0 comments on commit 229bf8e

Please sign in to comment.
You can’t perform that action at this time.