Hi,
I have problem during using the DataObjects->setFrom() function.
I can use it to copy data from an Array like $person->setFrom($_POST);
However, when I want to copy from another object, nothing happened.
My coding is:
$productB = new DataObjects_Product; $productB->get($productid);
$product = new DataObjects_Product;
$product->setFrom($productB);
$id = $product->insert();
The result is $product returns a blank DataObjects_Product without any data from $productB, am I using it right?
Ahh a bug yee have there...
if (is_object <http://www.php.net/is_object>($from) && @isset($from->$k)) {
$this->$k = $this->$k; continue
look for this in the setFrom method
and change
$this->$k = $this->$k; to
$this->$k = $from->$k;
regards
alan
Cheers,
William