mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Keeping BC on short syntax for Acl and Tree behavior.
This commit is contained in:
parent
3a04bb4733
commit
229bf8e984
3 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue