re: [PHP-PEAR] DataObject setFrom() problem

From: Date: Sat, 03 Aug 2002 16:07:11 +0000
Subject: re: [PHP-PEAR] DataObject setFrom() problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2044@lists.php.net to get a copy of this message
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


« previous php.pear.general (#2044) next »