fixing Set::extract()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3645 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2006-10-13 19:00:04 +00:00
parent 1c1bc8bfa8
commit 294bf20624

View file

@ -173,9 +173,12 @@ class Set extends Object {
* @uses NeatArray::value * @uses NeatArray::value
*/ */
function extract($array, $name = null) { function extract($array, $name = null) {
if(!is_array($array)) { if(!empty($array)) {
$name = $array; $name = $array;
$array = $this->get(); $array = $this->_value;
}
if(empty($array)) {
return false;
} }
$out = array(); $out = array();
foreach($array as $val) { foreach($array as $val) {