Re: Odd problem with DB_DataObject

From: Date: Mon, 24 Jan 2005 10:53:07 +0000
Subject: Re: Odd problem with DB_DataObject
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17126@lists.php.net to get a copy of this message
If it'd started my day by catching up on reading pear-general, rather than spending a couple of hours battling this problem I'd have found the solution! Doh. It seems that doing: define('DB_DATAOBJECT_NO_OVERLOAD', 1); before including any of the DB_DataObject files makes things work. I'm obviously not hardcore enough to understand what this does though... Phil On Mon, 24 Jan 2005 10:26:40 +0000, Phil Gyford <gyford@gmail.com> wrote: > Hi, > > Hopefully this is a really stupid mistake on my part, but I'm > stumped... I've narrowed my problem down to this simple test case: > > class TestClass extends DB_DataObject > { > function TestClass() > { > $this->testvar = 'hello world'; > } > > function testMethod() > { > > } > } > > $TESTOBJ = new TestClass(); > > var_dump($TESTOBJ); > > $TESTOBJ->testMethod(); > > var_dump($TESTOBJ); > > When var_dump() is called the first time, the object's contents are > displayed as you'd expect, with $testvar included. However, after > calling testMethod(), the second var_dump() simply displays 'NULL'. I > can't work out what's happening there to destroy the object. > > If I remove 'extends DB_DataObject' this test case works fine > (outputting the object with $testvar included both times), so it's > obviously something in DB_DataObject that I'm not fully grasping... > > Can anyone put me out of my misery? Many thanks... > > Phil >

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