DB_DataObject understanding Problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DB_DataObject understanding Problem

Torsten Raudssus
Hi,

I got a small problem understanding the use of the factory twice. I got
a function who reads some variable table. The problem is now very easy.
I don't know if i called the factory once or not.

function bla($ref) {
        ...
        $ref_db=&DB_DataObject::factory($ref);
        ...
        while($ref_db->fetch()) {
        ...
}

When i call the function second time with the same $ref, the result is
empty. Is there a way to "reset" a DataObject? that would help me over
that problem at first. Any hints could be helpful.

Bye!

--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply | Threaded
Open this post in threaded view
|

Re: DB_DataObject understanding Problem

Justin Patrin
On 5/8/05, Torsten Raudssus <[hidden email]> wrote:

> Hi,
>
> I got a small problem understanding the use of the factory twice. I got
> a function who reads some variable table. The problem is now very easy.
> I don't know if i called the factory once or not.
>
> function bla($ref) {
>         ...
>         $ref_db=&DB_DataObject::factory($ref);
>         ...
>         while($ref_db->fetch()) {
>         ...
> }
>
> When i call the function second time with the same $ref, the result is
> empty. Is there a way to "reset" a DataObject? that would help me over
> that problem at first. Any hints could be helpful.
>

You shouldn't need to do any "resetting". The factory sends you back a
completely new instance of the DO.

--
Justin Patrin

--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php