Re: DataObjects - staticGet not working as expected
| From: | Alan Knowles | Date: | Wed, 10 Sep 2003 10:37:01 +0000 |
| Subject: | Re: DataObjects - staticGet not working as expected | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7684@lists.php.net to get a copy of this message | ||
Jeroen Houben wrote:
Hi, staticGet is not working the way I expect it to. In have a class "Contacts" generated by DataObjects. I have added a propery called x. Consider the following code: $contact_id = 73; $contact =& PA_Contacts::staticGet($contact_id);
$_DB_DATAOBJECT['CACHE'][$lclass][$key] = $obj; return $_DB_DATAOBJECT['CACHE'][$lclass][$key]; I thought this should be: $_DB_DATAOBJECT['CACHE'][$lclass][$key] =& $obj; return $_DB_DATAOBJECT['CACHE'][$lclass][$key];the cache is there to prevent/reduce get requests.. - I didnt think being able to play around with the cache was a particularly good idea.. (actually I didnt expect anyone to try...) Acutally looking through the code I suspect getting rid of the alias before function &staticGet is probably a good idea... ... may even speed things up... Regards Alan
But it doesn't work either... Any ideas? jeroen-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com