Req #6202 [Opn]: getLinkArray() missing
| From: | nbraczek at bsds dot de | Date: | Fri, 09 Dec 2005 14:38:35 +0000 |
| Subject: | Req #6202 [Opn]: getLinkArray() missing | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-7285@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=6202&edit=1
ID: 6202
User updated by: nbraczek at bsds dot de
Reported By: nbraczek at bsds dot de
Status: Open
Id: 6202
Type: Feature/Change Request
Package: Documentation
PHP Version: Irrelevant
New Comment:
Of course, it must be
Synopsis
mixed $DB_DataObject->getLinkArray (string $column [, string $table])
Previous Comments:
------------------------------------------------------------------------
[2005-12-08 23:25:58] 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 />';
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=6202&edit=1