Open GoogleCodeExporter opened 8 years ago
The followings contain some bug fixed for above two methods: get_value() and
set_value()
public function get_value()
{
unset($value);
foreach ($this->names as $index => $_name)
{
if (is_array($this->values[$index]))
{
$value->$_name = array();
foreach ($this->values[$index] as $_value)
{
array_push($value->$_name, $_value->get_value());
}
}
else
{
if (isset($this->values[$index]) AND ! empty($this->values[$index]))
{
$value->$_name = $this->values[$index]->get_value();
}
}
}
return $value;
}
public function set_value($value)
{
foreach ($this->names as $index => $_name)
{
if ( ! isset($value->$_name))
continue;
if (is_array($value->$_name) AND is_array($this->values[$index]))
{
$this->values[$index] = array();
foreach ($value->$_name as $_value)
{
$class_object = new $this->fields[$index]();
$class_object->set_value($_value);
$this->values[$index][] = $class_object;
}
}
else
{
if ( ! isset($this->values[$index]) OR empty($this->values[$index]))
{
$this->values[$index] = new $this->fields[$index]();
}
$this->values[$index]->set_value($value->$_name);
}
}
}
Original comment by che...@gmail.com
on 7 Jul 2009 at 12:01
Original issue reported on code.google.com by
che...@gmail.com
on 28 Apr 2009 at 6:48