cvs: peardoc /en/package/structures/structures-datagrid custom-datasources.xml
| From: | Olivier Guilyardi | Date: | Tue, 02 May 2006 18:30:47 +0000 |
| Subject: | cvs: peardoc /en/package/structures/structures-datagrid custom-datasources.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7860@lists.php.net to get a copy of this message | ||
olivierg Tue May 2 18:30:47 2006 UTC
Modified files:
/peardoc/en/package/structures/structures-datagrid
custom-datasources.xml
Log:
- changed bogus <acronym>s to <emphasis>
- added some <classname>s and <parameter>s tags
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/structures/structures-datagrid/custom-datasources.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/custom-datasources.xml diff -u peardoc/en/package/structures/structures-datagrid/custom-datasources.xml:1.4 peardoc/en/package/structures/structures-datagrid/custom-datasources.xml:1.5 --- peardoc/en/package/structures/structures-datagrid/custom-datasources.xml:1.4 Sun Apr 23 13:13:38 2006 +++ peardoc/en/package/structures/structures-datagrid/custom-datasources.xml Tue May 2 18:30:47 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.structures.structures-datagrid.custom-datasources"> <refnamediv> @@ -11,39 +11,57 @@ <refsect1 id="package.structures.structures-datagrid.custom-datasources.intro"> <title>Introduction</title> - <para>Writing your own <acronym>DataSource driver</acronym> is the way to go when - none of the existing driver suit your needs. It is actually pretty easy, and allows - for great flexibility.</para> - <para>Of course, if you're trying to fetch data from an <emphasis>exotic - source</emphasis>, - writing your own driver is required. But, sometimes it's also the best way - to achieve the best <emphasis>optimization</emphasis>, especially (but not only) with + + <para>Writing your own DataSource driver is the way to go when none + of the existing driver suit your needs. It is actually pretty easy, + and allows for great flexibility.</para> + + <para>Of course, if you're trying to fetch data from an + <emphasis>exotic source</emphasis>, writing your own driver is + required. But, sometimes it's also the best way to achieve the best + <emphasis>optimization</emphasis>, especially (but not only) with databases.</para> - <para>This document will present you the <acronym>DataSource - interface</acronym>, and how to implement it.</para> + + <para>This document will present you the DataSource interface, and + how to implement it.</para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.custom-datasources.def"> <title>Definitions</title> - <para>A <acronym>DataSource driver</acronym> - is a descendent of the Structures_DataGrid_DataSource class, which - implements the <acronym>DataSource interface</acronym>.</para> - <para><acronym>DataSource</acronym> is a synomym for - <acronym>DataSource driver</acronym>.</para> - <para>The <acronym>DataSource interface</acronym> consists in a - set of methods that drivers must or may overload and protected properties + + <para><emphasis>A DataSource driver</emphasis> is a descendent of + the <classname>Structures_DataGrid_DataSource</classname> class, + which implements the <emphasis>DataSource interface</emphasis>.</para> + + <para><emphasis>DataSource</emphasis> is a synomym for + <emphasis>DataSource driver</emphasis>.</para> + + <para>The <emphasis>DataSource interface</emphasis> consists in a set + of methods that drivers must or may overload and protected properties that drivers can use, as well as recommended practices.</para> - <para>A <acronym>DataSource container</acronym> is a constant or a variable - of any type (string, array, object, etc...) that either contains data or - describes how to retrieve data.</para> - - <para>Every <acronym>DataSource driver</acronym> is specific to, and knows - how to handle, a given <acronym>DataSource container</acronym> type.</para> + <para>A <emphasis>DataSource container</emphasis> is a constant or + a variable of any type (string, array, object, etc...) that either + contains data or describes how to retrieve data.</para> + + <para>Every <emphasis>DataSource driver</emphasis> is specific to, + and knows how to handle, a given <emphasis>DataSource container</emphasis> + type.</para> </refsect1> <refsect1 id="package.structures.structures-datagrid.custom-datasources.interface"> <title>The DataSource interface</title> + + <refsect2 + id="package.structures.structures-datagrid.custom-datasources.interface.properties"> + <title>Properties available to drivers</title> + + <para><parameter>array $_options</parameter> - Data binding options as an + associative array. You can read the content of this property but you + shouldn't change it directly.</para> + + </refsect2> <refsect2 id="package.structures.structures-datagrid.custom-datasources.interface.methods"> <title>Methods that must or may be implemented in drivers</title> @@ -67,8 +85,9 @@ </funcsynopsis> <function>bind</function> is reponsible for loading a DataSource <parameter>container</parameter> into the driver, according to some - binding <parameter>options</parameter>. This method is optional. - It must return a PEAR_Error object in case of failure. + binding <parameter>options</parameter>. This method is optional. + It must return a <classname>PEAR_Error</classname> object in case + of failure. </para> <para> <funcsynopsis> @@ -80,7 +99,7 @@ <function>count</function> must return the total number or records found in the container. This method is required, and is always called before <function>fetch</function>. - It must return a PEAR_Error object in case of failure. + It must return a <classname>PEAR_Error</classname> object in case of failure. </para> <para> <funcsynopsis> @@ -90,10 +109,11 @@ <paramdef choice="opt">array <parameter>sortDir</parameter></paramdef> </funcprototype> </funcsynopsis> - <function>sort</function> must sort the data according to sortSpec and - the optional sortDir. This method is required, and is always called - before <function>fetch</function>. - It must return a PEAR_Error object in case of failure. + <function>sort</function> must sort the data according + to <parameter>sortSpec</parameter> and the optional + <parameter>sortDir</parameter>. This method is required, and is + always called before <function>fetch</function>. It must return + a <classname>PEAR_Error</classname> object in case of failure. </para> <para> <funcsynopsis> @@ -106,16 +126,35 @@ <function>fetch</function> must return a 2-dimension array of data, starting from record <parameter>offset</parameter>, containing <parameter>len</parameter> records..This method is required - It must return a PEAR_Error object in case of failure. + It must return a <classname>PEAR_Error</classname> object in case of failure. </para> </refsect2> <refsect2 - id="package.structures.structures-datagrid.custom-datasources.interface.properties"> - <title>Properties available to drivers</title> - <para><parameter>array $_options</parameter> - Data binding options as an - associative array. You can read the content of this property but you - shouldn't change it directly.</para> - </refsect2> + id="package.structures.structures-datagrid.custom-datasources.interface.methods-avail"> + <title>Protected methods that drivers can use</title> + <para> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>_addDefaultOptions</function></funcdef> + <paramdef choice="opt">array <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <function>_addDefaultOptions</function> is used to declare the + driver-specific options, if any, as well as their default values. + It must be called from the constructor. + </para> + <para> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>setOptions</function></funcdef> + <paramdef choice="opt">array <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <function>setOptions</function> is a public method used to set + options. If they ever need to change options, drivers should use this + method. + </para> + </refsect2> </refsect1> <refsect1> <title>A simple driver</title> @@ -218,7 +257,7 @@ <title>Using your new driver</title> <para>Okay, so you have written a driver that's tailored to your needs, and tested it. It is now time to connect it to - <acronym>Structures_DataGrid</acronym>.</para> + <classname>Structures_DataGrid</classname>.</para> <para>For this purpose we're going to use the <link @@ -243,8 +282,9 @@ </example> <para>That should output a sortable HTML table.</para> <para>Of course, the usual features of - <acronym>Structures_DataGrid</acronym> are now available to you: paging, - other output formats as XML, MS-Excel, etc...</para> + <classname>Structures_DataGrid</classname> are now + available to you: paging, other output formats as XML, MS-Excel, + etc...</para> </refsect1> <!-- <refsect1 @@ -252,11 +292,11 @@ <title>Writing an official driver</title> <para>The above example is a fully functional and valid <i>custom DataSource</i>. However, if you feel like writing an official and reusable - <acronym>Structures_DataGrid</acronym> driver, there's a little + Structures_DataGrid driver, there's a little more to know.</para> <para>What's an official driver? First it must be able to - <acronym>bind</acronym> a user-provided <acronym>DataSource - container</acronym>. And it may handle user options and additional + bind a user-provided DataSource + container. And it may handle user options and additional features.</para> --> </refentry>
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/structures/structures-datagrid/custom-datasources.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/custom-datasources.xml diff -u peardoc/en/package/structures/structures-datagrid/custom-datasources.xml:1.4 peardoc/en/package/structures/structures-datagrid/custom-datasources.xml:1.5 --- peardoc/en/package/structures/structures-datagrid/custom-datasources.xml:1.4 Sun Apr 23 13:13:38 2006 +++ peardoc/en/package/structures/structures-datagrid/custom-datasources.xml Tue May 2 18:30:47 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.structures.structures-datagrid.custom-datasources"> <refnamediv> @@ -11,39 +11,57 @@ <refsect1 id="package.structures.structures-datagrid.custom-datasources.intro"> <title>Introduction</title> - <para>Writing your own <acronym>DataSource driver</acronym> is the way to go when - none of the existing driver suit your needs. It is actually pretty easy, and allows - for great flexibility.</para> - <para>Of course, if you're trying to fetch data from an <emphasis>exotic - source</emphasis>, - writing your own driver is required. But, sometimes it's also the best way - to achieve the best <emphasis>optimization</emphasis>, especially (but not only) with + + <para>Writing your own DataSource driver is the way to go when none + of the existing driver suit your needs. It is actually pretty easy, + and allows for great flexibility.</para> + + <para>Of course, if you're trying to fetch data from an + <emphasis>exotic source</emphasis>, writing your own driver is + required. But, sometimes it's also the best way to achieve the best + <emphasis>optimization</emphasis>, especially (but not only) with databases.</para> - <para>This document will present you the <acronym>DataSource - interface</acronym>, and how to implement it.</para> + + <para>This document will present you the DataSource interface, and + how to implement it.</para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.custom-datasources.def"> <title>Definitions</title> - <para>A <acronym>DataSource driver</acronym> - is a descendent of the Structures_DataGrid_DataSource class, which - implements the <acronym>DataSource interface</acronym>.</para> - <para><acronym>DataSource</acronym> is a synomym for - <acronym>DataSource driver</acronym>.</para> - <para>The <acronym>DataSource interface</acronym> consists in a - set of methods that drivers must or may overload and protected properties + + <para><emphasis>A DataSource driver</emphasis> is a descendent of + the <classname>Structures_DataGrid_DataSource</classname> class, + which implements the <emphasis>DataSource interface</emphasis>.</para> + + <para><emphasis>DataSource</emphasis> is a synomym for + <emphasis>DataSource driver</emphasis>.</para> + + <para>The <emphasis>DataSource interface</emphasis> consists in a set + of methods that drivers must or may overload and protected properties that drivers can use, as well as recommended practices.</para> - <para>A <acronym>DataSource container</acronym> is a constant or a variable - of any type (string, array, object, etc...) that either contains data or - describes how to retrieve data.</para> - - <para>Every <acronym>DataSource driver</acronym> is specific to, and knows - how to handle, a given <acronym>DataSource container</acronym> type.</para> + <para>A <emphasis>DataSource container</emphasis> is a constant or + a variable of any type (string, array, object, etc...) that either + contains data or describes how to retrieve data.</para> + + <para>Every <emphasis>DataSource driver</emphasis> is specific to, + and knows how to handle, a given <emphasis>DataSource container</emphasis> + type.</para> </refsect1> <refsect1 id="package.structures.structures-datagrid.custom-datasources.interface"> <title>The DataSource interface</title> + + <refsect2 + id="package.structures.structures-datagrid.custom-datasources.interface.properties"> + <title>Properties available to drivers</title> + + <para><parameter>array $_options</parameter> - Data binding options as an + associative array. You can read the content of this property but you + shouldn't change it directly.</para> + + </refsect2> <refsect2 id="package.structures.structures-datagrid.custom-datasources.interface.methods"> <title>Methods that must or may be implemented in drivers</title> @@ -67,8 +85,9 @@ </funcsynopsis> <function>bind</function> is reponsible for loading a DataSource <parameter>container</parameter> into the driver, according to some - binding <parameter>options</parameter>. This method is optional. - It must return a PEAR_Error object in case of failure. + binding <parameter>options</parameter>. This method is optional. + It must return a <classname>PEAR_Error</classname> object in case + of failure. </para> <para> <funcsynopsis> @@ -80,7 +99,7 @@ <function>count</function> must return the total number or records found in the container. This method is required, and is always called before <function>fetch</function>. - It must return a PEAR_Error object in case of failure. + It must return a <classname>PEAR_Error</classname> object in case of failure. </para> <para> <funcsynopsis> @@ -90,10 +109,11 @@ <paramdef choice="opt">array <parameter>sortDir</parameter></paramdef> </funcprototype> </funcsynopsis> - <function>sort</function> must sort the data according to sortSpec and - the optional sortDir. This method is required, and is always called - before <function>fetch</function>. - It must return a PEAR_Error object in case of failure. + <function>sort</function> must sort the data according + to <parameter>sortSpec</parameter> and the optional + <parameter>sortDir</parameter>. This method is required, and is + always called before <function>fetch</function>. It must return + a <classname>PEAR_Error</classname> object in case of failure. </para> <para> <funcsynopsis> @@ -106,16 +126,35 @@ <function>fetch</function> must return a 2-dimension array of data, starting from record <parameter>offset</parameter>, containing <parameter>len</parameter> records..This method is required - It must return a PEAR_Error object in case of failure. + It must return a <classname>PEAR_Error</classname> object in case of failure. </para> </refsect2> <refsect2 - id="package.structures.structures-datagrid.custom-datasources.interface.properties"> - <title>Properties available to drivers</title> - <para><parameter>array $_options</parameter> - Data binding options as an - associative array. You can read the content of this property but you - shouldn't change it directly.</para> - </refsect2> + id="package.structures.structures-datagrid.custom-datasources.interface.methods-avail"> + <title>Protected methods that drivers can use</title> + <para> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>_addDefaultOptions</function></funcdef> + <paramdef choice="opt">array <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <function>_addDefaultOptions</function> is used to declare the + driver-specific options, if any, as well as their default values. + It must be called from the constructor. + </para> + <para> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>setOptions</function></funcdef> + <paramdef choice="opt">array <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <function>setOptions</function> is a public method used to set + options. If they ever need to change options, drivers should use this + method. + </para> + </refsect2> </refsect1> <refsect1> <title>A simple driver</title> @@ -218,7 +257,7 @@ <title>Using your new driver</title> <para>Okay, so you have written a driver that's tailored to your needs, and tested it. It is now time to connect it to - <acronym>Structures_DataGrid</acronym>.</para> + <classname>Structures_DataGrid</classname>.</para> <para>For this purpose we're going to use the <link @@ -243,8 +282,9 @@ </example> <para>That should output a sortable HTML table.</para> <para>Of course, the usual features of - <acronym>Structures_DataGrid</acronym> are now available to you: paging, - other output formats as XML, MS-Excel, etc...</para> + <classname>Structures_DataGrid</classname> are now + available to you: paging, other output formats as XML, MS-Excel, + etc...</para> </refsect1> <!-- <refsect1 @@ -252,11 +292,11 @@ <title>Writing an official driver</title> <para>The above example is a fully functional and valid <i>custom DataSource</i>. However, if you feel like writing an official and reusable - <acronym>Structures_DataGrid</acronym> driver, there's a little + Structures_DataGrid driver, there's a little more to know.</para> <para>What's an official driver? First it must be able to - <acronym>bind</acronym> a user-provided <acronym>DataSource - container</acronym>. And it may handle user options and additional + bind a user-provided DataSource + container. And it may handle user options and additional features.</para> --> </refentry>