DB_DataObject getLinks problem
| From: | Graham Ford | Date: | Sun, 01 May 2005 22:29:52 +0000 |
| Subject: | DB_DataObject getLinks problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19031@lists.php.net to get a copy of this message | ||
Hi guys,
I have been struggling with this for days now, and still cant seem to find
an answer to the problem. Basically, when I use the getLinks() method, I
get back and array with all the correct fields in it, but none of the
fields have any values. This is what I am doing...
I have two tables, called Comps and AllTimeComps, as follows-
[AllTimeComps]
ID = 129
Name = 130
[AllTimeComps__keys]
ID = N
[Comps]
Id = 129
Name = 130
AllTimeId = 129
[Comps__keys]
Id = N
And my links.ini file looks like this-
[Comps]
AllTimeId=AllTimeComps:Id
I then get a list of comps and call get links-
$compTable = &DB_DataObject::Factory('Comps');
$compTable->find();
while ($compTable->fetch())
{
$compTable->getLinks();
print_r($compTable);
}
an extract of the result of this is, showing Id and Name as empty -
dataobjects_comps Object
(
[__table] => Comps
[Id] => 13
[Name] => Play-Off Final
[AllTimeId] => 4
[fb_linkDisplayFields] => Array
(
[0] => Name
)
[_DB_DataObject_version] => 1.7.13
[N] => 19
[_database_dsn] =>
[_database_dsn_md5] => 6a39b595a9928b2d933398138134a49f
[_database] => wdcweb_romfordraiderscouk1
[_DB_resultid] => 1
[_link_loaded] => Array
(
[0] => _AllTimeId
)
[_join] =>
[_lastError] =>
[_AllTimeId] => dataobjects_alltimecomps Object
(
[_DB_DataObject_version] => 1.7.13
[__table] => AllTimeComps
[N] => 0
[_database_dsn] =>
[_database_dsn_md5] =>
[_database] =>
[_query] => Array
(
[condition] =>
[group_by] =>
[order_by] =>
[having] =>
[limit_start] =>
[limit_count] =>
[data_select] => *
)
[_DB_resultid] =>
[_link_loaded] =>
[_join] =>
[_lastError] =>
[Id] =>
[Name] =>
[fb_linkDisplayFields] => Array
(
[0] => Name
)
)
)
When I turn on debug, I can see that the select statement for the join is
run, and the result is auto-fetched, but I still get no result back. Has
anyone ever seen this before, or have any idea what I have done wrong?
I know the links.ini file is being picked up, as when I use the
FormBuilder, it picks up the links, and auto-generates the selectbox's.
Am I missing something?
Thanks
Graham Ford