Re: DB_DataObject link problem (Does DB_DataObject try to set up auto links?)
| From: | Justin Patrin | Date: | Tue, 22 Mar 2005 19:00:33 +0000 |
| Subject: | Re: DB_DataObject link problem (Does DB_DataObject try to set up auto links?) | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18240@lists.php.net to get a copy of this message | ||
On Tue, 22 Mar 2005 12:33:32 -0600, Jachin Rupe <jachin@csihosting.com> wrote:
> So I created a links.ini file that looks like this:
>
> [catalogs]
> id = products:catalog_id
You don't need to do this. In the links.ini file you specify which
fields are foreign keys / links. You have to show which field it links
*to*. So the one below is the correct one.
>
> [products]
> catalog_id = catalogs:id
>
> I'm not sure if I should link both of the tables to each other but I
> tried just one or the other and had the same results.
>
> Anyway when I try to do some linking:
> $product->get(1);
> $product->getLinks();
getLinks isn't really the best thing to use. It's better to use getLink(). i.e.
$catalog =& $product->getLink('catalog_id');
>
> I get no links. I turned on debugging and here are the highlights:
>
> dataobjects_products: databaseStructure: Missing ini file:
> /htdocs/test.lan/maval_catalog_admin/includes/DataObjects/maval_catalog_new.ini
> dataobjects_products:
>
> dataobjects_products: databaseStructure: Missing links.ini file:
> /htdocs/test.lan/maval_catalog_admin/includes/DataObjects/maval_catalog_new.links.ini
>
Well, here's the main problem. Your database's ini file and links.ini
file aren't being found. Are they in the location mentioned in the
debug output? I doubt it as it says it can't find them. Are they named
right?
--
Justin Patrin