cvs: peardoc /en/package/database/db-dataobject/db-dataobject getlinks.xml

From: Date: Tue, 26 Aug 2003 19:17:27 +0000
Subject: cvs: peardoc /en/package/database/db-dataobject/db-dataobject getlinks.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-1417@lists.php.net to get a copy of this message
arnaud Tue Aug 26 15:17:27 2003 EDT Modified files: /peardoc/en/package/database/db-dataobject/db-dataobject getlinks.xml Log: * add three tables join example Index: peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml diff -u peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml:1.4 peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml:1.5 --- peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml:1.4 Tue Aug 26 15:16:56 2003 +++ peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml Tue Aug 26 15:17:27 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.database.db-dataobject.db-dataobject.getlinks"> <refnamediv> <refname>-&gt;getLinks()</refname> @@ -6,13 +6,9 @@ </refnamediv> <refsynopsisdiv> <funcsynopsis> - <funcprototype> <funcdef>boolean <function>$DB_DataObject-&gt;getLinks</function></funcdef> - - <paramdef></paramdef> - </funcprototype> </funcsynopsis> </refsynopsisdiv> @@ -38,9 +34,7 @@ <refsect1 id="package.database.db-dataobject.db-dataobject.getlinks.note"> &title.note; - &note.notstatic; - <simpara></simpara> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.getlinks.see"> @@ -93,6 +87,15 @@ | rpga_convention_code | varchar(20) | | | | | | web_site_url | varchar(200) | | | | | | last_modified | timestamp(14) | YES | | NULL | | +| room_id | int(11) | | | | | ++----------------------+---------------+------+-----+---------+----------------+ + +Room ++----------------------+---------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++----------------------+---------------+------+-----+---------+----------------+ +| room_id | int(11) | | PRI | 0 | auto_increment | +| name | varchar(50) | | | | | +----------------------+---------------+------+-----+---------+----------------+ ]]> @@ -198,6 +201,7 @@ [rpga_convention_code] => ABCD_XYZ [web_site_url] => http://example.com [last_modified] => 20020703143828 + [room_id] => 1 ) [_last_modified] => @@ -205,6 +209,44 @@ ]]> </programlisting> </example> + <example> + <title>Example with three tables join</title> + <programlisting role="php"> + <![CDATA[ +/** + * The following example show a three tables join. + * + * More joins can be nested as you see fit. + */ +$person = new DataObjects_Person; + +$data = array(); +if ($person->find()) { + while ($person->fetch()) { + $person->getLinks(); + // Following is another call to getLinks for the second join + $person->_convention_id->getLinks(); + $data[] = $person->_convention_id->_room_id->ToArray(); + } +} + +print_r($data); +]]> + </programlisting> + </example> + <example> + <title>databasename.links.ini</title> + <programlisting> + <![CDATA[ +; this ini file is for the three tables join example above. +[person] +person_id = convention:person_id + +[room] +room_id = convention:room_id +]]> + </programlisting> + </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file @@ -225,4 +267,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +--> \ No newline at end of file

« previous php.pear.doc (#1417) next »