mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Fixing implementation of Set::remove() for instance and static calling
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4523 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a633a7392a
commit
770446905a
1 changed files with 9 additions and 4 deletions
|
@ -286,9 +286,8 @@ class Set extends Object {
|
||||||
* @param mixed $path A dot-separated string.
|
* @param mixed $path A dot-separated string.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function remove(&$list, $path, $data = null) {
|
function remove($list, $path = null) {
|
||||||
if (empty($data) && is_a($this, 'Set')) {
|
if (empty($path) && is_a($this, 'Set')) {
|
||||||
$data = $path;
|
|
||||||
$path = $list;
|
$path = $list;
|
||||||
$list = $this->get();
|
$list = $this->get();
|
||||||
}
|
}
|
||||||
|
@ -310,7 +309,13 @@ class Set extends Object {
|
||||||
$_list =& $_list[$key];
|
$_list =& $_list[$key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $list;
|
|
||||||
|
if (is_a($this, 'Set')) {
|
||||||
|
$this->value = $list;
|
||||||
|
return $this;
|
||||||
|
} else {
|
||||||
|
return $list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Checks if a particular path is set in an array
|
* Checks if a particular path is set in an array
|
||||||
|
|
Loading…
Reference in a new issue