cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid datasources.xml
/en/package/structures/structures-datagrid/structures-datagrid datasourcefactory.xml getdatasource.xml getrenderer.xml

From: Date: Thu, 29 Jun 2006 22:04:28 +0000
Subject: cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid datasources.xml
/en/package/structures/structures-datagrid/structures-datagrid datasourcefactory.xml getdatasource.xml getrenderer.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8097@lists.php.net to get a copy of this message
olivierg Thu Jun 29 22:04:28 2006 UTC Added files: /peardoc/en/package/structures/structures-datagrid/structures-datagrid datasourcefactory.xml getdatasource.xml Modified files: /peardoc/en/package/structures structures-datagrid.xml /peardoc/en/package/structures/structures-datagrid datasources.xml /peardoc/en/package/structures/structures-datagrid/structures-datagrid getrenderer.xml Log: add datasourceFactory() and getDataSource() - fix getRenderer() - work on datasources.xml

http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid.xml?r1=1.29&r2=1.30&diff_format=u Index: peardoc/en/package/structures/structures-datagrid.xml diff -u peardoc/en/package/structures/structures-datagrid.xml:1.29 peardoc/en/package/structures/structures-datagrid.xml:1.30 --- peardoc/en/package/structures/structures-datagrid.xml:1.29 Wed Jun 28 22:06:39 2006 +++ peardoc/en/package/structures/structures-datagrid.xml Thu Jun 29 22:04:28 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.29 $ --> +<!-- $Revision: 1.30 $ --> <sect1 id="package.structures.structures-datagrid"> <title>Structures_DataGrid</title> <!-- @@ -55,6 +55,7 @@ &package.structures.structures-datagrid.structures-datagrid.bind; &package.structures.structures-datagrid.structures-datagrid.binddatasource; &package.structures.structures-datagrid.structures-datagrid.build; +&package.structures.structures-datagrid.structures-datagrid.datasourcefactory; &package.structures.structures-datagrid.structures-datagrid.fill; &package.structures.structures-datagrid.structures-datagrid.getcolumnbyfield; &package.structures.structures-datagrid.structures-datagrid.getcolumnbyname; @@ -62,6 +63,7 @@ &package.structures.structures-datagrid.structures-datagrid.getcurrentpage; &package.structures.structures-datagrid.structures-datagrid.getcurrentrecordnumberend; &package.structures.structures-datagrid.structures-datagrid.getcurrentrecordnumberstart; +&package.structures.structures-datagrid.structures-datagrid.getdatasource; &package.structures.structures-datagrid.structures-datagrid.getoutput; &package.structures.structures-datagrid.structures-datagrid.getpagecount; &package.structures.structures-datagrid.structures-datagrid.getrecordcount; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/datasources.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/datasources.xml diff -u peardoc/en/package/structures/structures-datagrid/datasources.xml:1.5 peardoc/en/package/structures/structures-datagrid/datasources.xml:1.6 --- peardoc/en/package/structures/structures-datagrid/datasources.xml:1.5 Wed Jun 28 20:48:29 2006 +++ peardoc/en/package/structures/structures-datagrid/datasources.xml Thu Jun 29 22:04:28 2006 @@ -1,16 +1,18 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="package.structures.structures-datagrid.datasources"> + <!-- FIXME There's something very wrong in this document. It has a + terrible style... And it contains obsolete informations. --> <refnamediv> - <refname>Data Sources</refname> - <refpurpose>What is a Data Source Driver?</refpurpose> + <refname>DataSources</refname> + <refpurpose>What is a DataSource Driver?</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para> - A Data Source is rather self explainitory by it's name alone; however, a - Data Source Driver in context to the DataGrid can become a very essential - key to your software. A Data Source Driver will interact with your data + A DataSource has a rather self-explanatory name ; however, a + DataSource Driver in context to the DataGrid can become a very essential + key to your software. A DataSource Driver will interact with your data source directly, such as a DB_DataObject or DB_Result object and handle all of the paging and sorting code for you, resulting in very few lines of code that you will need to write. @@ -20,7 +22,7 @@ <title>How to use the drivers</title> <para> To use the drivers, you can simply use the bind method, assuming your - data source is listed below, otherwise you can use the + DataSource is listed below, otherwise you can use the <function>bindDataSource</function> method. The <link linkend="package.structures.structures-datagrid.structures-datagrid.bind"><function>bind</function></link> @@ -28,18 +30,18 @@ may not be 100% accurate. Because of this chance for error, you may choose to use the bindDataSource method where you can specifically define the datasource driver to use. This method is also the method of choice - if you are building your own custom Data Source Driver. + if you are building your own custom DataSource Driver. </para> </refsect1> <refsect1> - <title>Currently Available Data Source Drivers</title> + <title>Currently Available DataSource Drivers</title> <para> The following listed drivers are currently packaged in with Structures_DataGrid. </para> <refsect2> <title>PEAR::DB_DataObject Object</title> <para> - The DataObject is the most optimal data source for the datagrid because + The DataObject is the most optimal DataSource for the datagrid because it allows the datagrid to only fetch the necessary records upon rendering. Please note that when binding to a dataobject, do not run the fetch method prior since the datagrid will run the fetch method http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/getrenderer.xml?r1=1.8&r2=1.9&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/getrenderer.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid/getrenderer.xml:1.8 peardoc/en/package/structures/structures-datagrid/structures-datagrid/getrenderer.xml:1.9 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid/getrenderer.xml:1.8 Thu Jun 29 16:43:36 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/getrenderer.xml Thu Jun 29 22:04:28 2006 @@ -1,8 +1,8 @@ -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.getrenderer"> <refnamediv> <refname><function>Structures_DataGrid::getRenderer</function></refname> - <refpurpose>Get Renderer</refpurpose> + <refpurpose>Get the current or default Rendering driver</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> @@ -10,7 +10,7 @@ require_once &apos;Structures/DataGrid.php&apos;; </funcsynopsisinfo> <funcprototype> - <funcdef>void&amp; <function>Structures_DataGrid::getRenderer</function></funcdef> + <funcdef>object Renderer&amp; <function>Structures_DataGrid::getRenderer</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> @@ -21,6 +21,12 @@ <para>Retrieves the renderer object as a reference</para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid.getrenderer.returns"> + &title.returns; + <para> + <emphasis>returns</emphasis> object reference + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.getrenderer.throws"> &title.throws; <para> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/datasourcefactory.xml?view=markup&rev=1.1 Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/datasourcefactory.xml +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/datasourcefactory.xml <!-- $Revision: 1.1 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory"> <refnamediv> <refname><function>Structures_DataGrid::datasourceFactory</function></refname> <refpurpose>Datasource driver Factory</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;Structures/DataGrid.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>Structures_DataGrid_DataSource|PEAR_Error&amp; <function>Structures_DataGrid::datasourceFactory</function></funcdef> <paramdef>mixed <parameter>$source</parameter></paramdef> <paramdef>array <parameter> <optional>$options = array()</optional></parameter></paramdef> <paramdef>string <parameter> <optional>$type = &null;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory.desc"> &title.desc; <para>A clever method which loads and instantiate data source drivers.</para> <para>Can be called in various ways:</para> <para>Detect the source type and load the appropriate driver with default options: <programlisting role="php-highlighted">1 $driver =&amp; <link linkend="package.structures.structures-datagrid.structures-datagrid.structures-datagrid">Structures_DataGrid</link>::<link linkend="package.structures.structures-datagrid.structures-datagrid.datasourcefactory">datasourceFactory</link>($source); </programlisting></para> <para>Detect the source type and load the appropriate driver with custom options: <programlisting role="php-highlighted">1 $driver =&amp; <link linkend="package.structures.structures-datagrid.structures-datagrid.structures-datagrid">Structures_DataGrid</link>::<link linkend="package.structures.structures-datagrid.structures-datagrid.datasourcefactory">datasourceFactory</link>($source, $options); </programlisting></para> <para>Load a driver for an explicit type (faster, bypasses detection routine): <programlisting role="php-highlighted">1 $driver =&amp; <link linkend="package.structures.structures-datagrid.structures-datagrid.structures-datagrid">Structures_DataGrid</link>::<link linkend="package.structures.structures-datagrid.structures-datagrid.datasourcefactory">datasourceFactory</link>($source, $options, $type); </programlisting></para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$source</parameter> </term> <listitem> <para> The data source respective to the driver </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.array; <parameter>$options</parameter> </term> <listitem> <para> An associative array of the form: array(optionName =&gt; optionValue, ...) </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$type</parameter> </term> <listitem> <para> The data source type constant (of the form DATAGRID_SOURCE_*) </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory.returns"> &title.returns; <para> <emphasis>returns</emphasis> driver object or PEAR_Error on failure </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory.see"> &title.see; <para> <emphasis>see</emphasis> Structures_DataGrid::_detectSourceType() </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.datasourcefactory.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/getdatasource.xml?view=markup&rev=1.1 Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/getdatasource.xml +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/getdatasource.xml <!-- $Revision: 1.1 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.getdatasource"> <refnamediv> <refname><function>Structures_DataGrid::getDataSource</function></refname> <refpurpose>Get the currently loaded DataSource driver</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;Structures/DataGrid.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>object DataSource&amp; <function>Structures_DataGrid::getDataSource</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.getdatasource.desc"> &title.desc; <para>Retrieves the DataSource object as a reference</para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.getdatasource.returns"> &title.returns; <para> <emphasis>returns</emphasis> object reference or null if no driver is loaded </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.getdatasource.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.getdatasource.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#8097) next »