->getLink() -- fetch and return a related object
Opis
Fetch a related object.
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 and column.
Parametr
string $column -
either column or column.xxxxx
string $table - name of table to look up value in
string $link - name of column in other table to match
Zwracana wartość
mixed - object on success or FALSE on failure.
Uwagi
Ta funkcja nie może być wywołana
statycznie.
Przykład
Przykład 35-1. Getting the related object
<?php
$person = new DataObjects_Person;
$person->get(12);
$group = $person->getLink('group_owner');
echo $group->name;
$group = $person->getLink('colourid','hair');
?>
|
|
|
Automatic Table Linking and Joins (Previous)
|
(Next) ->getLinks()
|
|
|
Download Documentation
|
Last updated: Mon, 02 Jul 2007 |
|
Do you think that something on this page is wrong? Please file a bug report or add a note.
|
| User Notes: |
Note by: archenemy@gafapasta.com
does this work at all when passing 3 parameters? i'm getting a full select of the linked table with the first result returned as the 'link'.
even the parameter names in the function definition don't match the explanation a few lines down in the doc.
|
|