re: [PEAR][DB][DataObject] links.ini
| From: | Matthias H. Risse | Date: | Thu, 11 Sep 2003 21:35:33 +0000 |
| Subject: | re: [PEAR][DB][DataObject] links.ini | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7748@lists.php.net to get a copy of this message | ||
hi andy, hi all others!
finally here is my derived code from
the manpages. what's my problem?
// ################################################################
// code
// ################################################################
$person = new DataObjects_Users;
$person->affiliationID = '1';
/*
// without links.ini
// works
$person->find();
while ($person->fetch()) {
// this will look up in the cars table for the id matching the
person->car value.
$organization =
$person->getLink('affiliationID','Organization','ID');
echo "{$person->login} is associated with
{$organization->name}<br>\n";
echo "<br><br>";
print_r($organization);
echo "<br><br>";
}
*/
// with links.ini
// doesnt work
$person->find();
while ($person->fetch()) {
// use the links.ini file to automatically load
// the car object into $person->_car <<<< EH? well..
$person->getLinks();
echo "{$person->login} loves to work at
{$person->_affiliationID->name}\n<br><br>";
print_r($person);
echo "<br><br>";
}
?>
// ################################################################
// mydbname.links.ini
// ################################################################
[users]
affiliationID = organization:ID