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

From: Date: Mon, 05 Aug 2002 08:33:11 +0000
Subject: Re: re: [PHP-PEAR] DataObject setFrom() problem
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2051@lists.php.net to get a copy of this message
Ok, thanks! Cheers, William ----- Original Message ----- From: "Alan Knowles" <alan@akbkhome.com> To: <pear-general@lists.php.net> Cc: "William" <william@adtio.com> Sent: Sunday, August 04, 2002 12:07 AM Subject: [PEAR] re: [PHP-PEAR] DataObject setFrom() problem > > > >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 > > > > > > > > > > > > > > > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

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