cvs: peardoc /en/package/database/db-dataobject/db-dataobject getlinks.xml joinadd.xml
| From: | Alan Knowles | Date: | Tue, 11 Nov 2003 14:16:35 +0000 |
| Subject: | cvs: peardoc /en/package/database/db-dataobject/db-dataobject getlinks.xml joinadd.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-1943@lists.php.net to get a copy of this message | ||
alan_k Tue Nov 11 09:16:35 2003 EDT
Modified files:
/peardoc/en/package/database/db-dataobject/db-dataobject
getlinks.xml
joinadd.xml
Log:
sync join and links to reality
Index: peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml
diff -u peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml:1.5
peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml:1.6
--- peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml:1.5 Tue Aug 26 15:17:27
2003
+++ peardoc/en/package/database/db-dataobject/db-dataobject/getlinks.xml Tue Nov 11 09:16:35 2003
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<refentry id="package.database.db-dataobject.db-dataobject.getlinks">
<refnamediv>
<refname>->getLinks()</refname>
@@ -8,7 +8,11 @@
<funcsynopsis>
<funcprototype>
<funcdef>boolean
<function>$DB_DataObject->getLinks</function></funcdef>
- <paramdef></paramdef>
+
+ <paramdef>
+ string <parameter><optional>$variableFormat</optional></parameter>
+ </paramdef>
+
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@@ -24,7 +28,44 @@
files should be used.
</para>
</refsect1>
+ <refsect1 id="package.database.db-dataobject.db-dataobject.getlinks.parameter">
+ &title.param;
+ <para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <parameter>string $variableFormat</parameter> - the default behavior is to
assign the resulting
+ objects to variables with the row name prefixed with an underscode
(<parameter>_</parameter>), however,
+ you can use this value to format the variable differently
+ <title> examples of formaters </title>
+ <programlisting role="ini"><![CDATA[
+
+if room.occupied_by is linked to a person.id
+
+without a modifier - eg _%s
+
+
+results in the equivilant of
+$object->_occupied_by = $object->getLink('occupied_by');
+
+
+with a modifier - eg link_%s
+
+results in the equivilant of
+$object->link_occupied_by = $object->getLink('occupied_by');
+
+
+ ]]></programlisting>
+
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </refsect1>
+
+
<refsect1 id="package.database.db-dataobject.db-dataobject.getlinks.return">
&title.returns;
<para>
Index: peardoc/en/package/database/db-dataobject/db-dataobject/joinadd.xml
diff -u peardoc/en/package/database/db-dataobject/db-dataobject/joinadd.xml:1.6
peardoc/en/package/database/db-dataobject/db-dataobject/joinadd.xml:1.7
--- peardoc/en/package/database/db-dataobject/db-dataobject/joinadd.xml:1.6 Fri Aug 1 22:34:37 2003
+++ peardoc/en/package/database/db-dataobject/db-dataobject/joinadd.xml Tue Nov 11 09:16:35 2003
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<refentry id="package.database.db-dataobject.db-dataobject.joinadd">
<refnamediv>
<refname>->joinAdd()</refname>
@@ -14,7 +14,18 @@
object <parameter><optional>$dataobject</optional></parameter>
</paramdef>
+ <paramdef>
+ string <parameter><optional>$joinType</optional></parameter>
+ </paramdef>
+ <paramdef>
+ string <parameter><optional>$joinAs</optional></parameter>
+ </paramdef>
+
+ <paramdef>
+ string <parameter><optional>$joinCol</optional></parameter>
+ </paramdef>
+
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@@ -24,6 +35,11 @@
Builds a Join Query, by adding another dataobject to this one. Be careful when using this,
raw queries may be clearer than using joinAdd.
</para>
+
+ <para>
+ Thanks to Stijn de Reede for the implementation of this.
+ </para>
+
</refsect1>
<refsect1 id="package.database.db-dataobject.db-dataobject.joinadd.parameter">
@@ -35,7 +51,48 @@
<para>
<parameter>object $obj</parameter> - joining object (no value resets the join)
</para>
- </listitem>
+ </listitem>
+
+
+ <listitem>
+ <para>
+ <parameter>string $joinType</parameter> - "LEFT" |
"INNER " | "RIGHT" | ""
+ </para><para>
+ INNER is default, "" indicates
+ just select ... from a,b,c with no join and
+ links are added as where items.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <parameter>string $joinAs</parameter> - if you want to select the table as
anther name
+ useful when you want to select multiple columns from a secondary table.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <parameter>string $joinCol</parameter> - The column on This objects table to
match,needed
+ if this table links to the child object in
+ multiple places eg.
+
+ <example>
+ <title> using specific join Columns </title>
+ <programlisting role="ini"><![CDATA[
+
+user->friend (is a id of a person)
+user->mother (is a id of another person)
+
+
+ ]]></programlisting>
+ </example>
+
+ </para>
+ </listitem>
+
</itemizedlist>
</para>