Home » Database » DB_DataObject » Bug #6202
getLinkArray() missing
Details
| Doc Bug #6202 | getLinkArray() missing |
|---|---|
| Submitted | 2005-12-09 04:25 UTC |
| From | nbraczek at bsds dot de |
| Status | Open |
| Package | DB_DataObject |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-12-09 04:25 UTC] nbraczek at bsds dot de
Description:
------------
The quite usefull method getLinkArray() is not mentioned in the documentation. It is found in DB_DataObject 1.7.15 with a wrong/misleading description.
The doc entry should look like this:
(see 'Test script' field)
regards,
Niels Braczek <nbraczek@bsds.de>
Test script:
---------------
-> getLinkArray()
-> getLinkArray() -- fetch and return a list of related objects
Synopsis
mixed $DB_DataObject->getLink (string $column [, string $table])
Description
Fetch an array of related objects. This should be used in conjunction with a <dbname>.links.ini file configuration (see the introduction on linking for details on this).
You may also use this with all parameters to specify, the column and related table.
Parameter
* string $column - either column or column.xxxxx
* string $table - name of table to look up value in
Return value
array - array of results (empty array on failure)
Note
This function can not be called statically.
Example
Example xx-1. Getting the related objects
<?php
$person = new DataObjects_Person;
$person->get(12);
$children = $person->getLinkArray('children');
echo 'There are ', count($children), ' descendant(s):<br />';
foreach ($children as $child) {
echo $child->name, '<br />';
}
?>
[2005-12-09 14:38 UTC] nbraczek at bsds dot de
Of course, it must be
Synopsis
mixed $DB_DataObject->getLinkArray (string $column [, string $table])