Re: DB_DataObjects getLinks() bug?
| From: | Justin Patrin | Date: | Fri, 08 Jul 2005 18:37:45 +0000 |
| Subject: | Re: DB_DataObjects getLinks() bug? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19920@lists.php.net to get a copy of this message | ||
On 7/8/05, Mark Petersen <markp@cherryone.com> wrote:
> When I some something like this:
>
> $warrior = new DataObjects_warrior_items;
>
> //Set Items for logged in warrior
> $warrior->warriorID = $auth->getAuthData('id');
>
> //find items
> $warrior->find();
> while ($warrior->fetch()) {
> $warrior->getLinks();
>
> //print object
> print_r($warrior);
> }
>
> While the record updates appropriately when fetched, I only get the
> links for the first record fetched. The database structure is as below:
>
> warrior
> id
> name
> password
>
> warriorItems
> itemID
> warriorID
> itemDescription
>
> warriors.links.ini
> [warriorItems]
> warriorID = warrior:id
>
>
> Is there some command I need to remove the old links? I want to keep
> the records I've already found of course, so I can't create a new
> object. I guess I'll try something like this after the e-mail:
> $warrior_temp = $warrior;
> $warrior_temp->getLinks();
> print_r($warrior_temp);
>
> I wouldn't think that should be necessary though... possibly a bug?
> When I fetch the next record I assume it would drop the old links.
>
As I always suggest: don't use getLinks(). Use getLink to get the
specific link(s) you need.
$linked =& $do->getLink('field');
--
Justin Patrin