From 770446905af6c4517d48d848078aeae36a6e7e69 Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 15 Feb 2007 20:39:43 +0000 Subject: [PATCH] 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 --- cake/libs/set.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index 6301e5809..d663df009 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -286,9 +286,8 @@ class Set extends Object { * @param mixed $path A dot-separated string. * @return array */ - function remove(&$list, $path, $data = null) { - if (empty($data) && is_a($this, 'Set')) { - $data = $path; + function remove($list, $path = null) { + if (empty($path) && is_a($this, 'Set')) { $path = $list; $list = $this->get(); } @@ -310,7 +309,13 @@ class Set extends Object { $_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