cvs: peardoc /en/package/database/db-dataobject/db-dataobject database.xml factory.xml keys.xml table.xml tablename.xml
| From: | Alan Knowles | Date: | Tue, 11 Nov 2003 12:18:52 +0000 |
| Subject: | cvs: peardoc /en/package/database/db-dataobject/db-dataobject database.xml factory.xml keys.xml table.xml tablename.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-1936@lists.php.net to get a copy of this message | ||
alan_k Tue Nov 11 07:18:52 2003 EDT
Added files:
/peardoc/en/package/database/db-dataobject/db-dataobject
database.xml
factory.xml
keys.xml
table.xml
tablename.xml
Log:
add some of the missing methods
Index: peardoc/en/package/database/db-dataobject/db-dataobject/database.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/database.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.database"> <refnamediv> <refname>->database()</refname> <refpurpose>Get or set the database the object uses</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->database</function></funcdef> <paramdef> string <parameter><optional>$name</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.database.desc"> &title.desc; <para> Without any argument, it returns the database that the object deals with. With a string, it will set the database for the instance of the object. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.database.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.database.example"> &title.example; <example> <title>Getting the database name</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; echo $person->database(); // echo's mydatabase // now use the same object to check on a mirror.. $person->database('mirror1'); $person->id = 12; $person->find(true); ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/factory.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/factory.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.factory"> <refnamediv> <refname>DB_DataObject::factory()</refname> <refpurpose>Autoload and instantate class based on table name.</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>mixed <function>DB_DataObject::factory</function></funcdef> <paramdef> string <parameter>$table</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.desc"> &title.desc; <para> This is the recommended way to autoload a class, and instantate it. The class is loaded based on the configuration settings for table to class naming. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $table</parameter> - the table you want to load </para> </listitem> <listitem> <para> <parameter>string $key</parameter> - column (or value if only 2 paramaters are given) </para> </listitem> <listitem> <para> <parameter>mixed $value</parameter> - value </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.return"> &title.returns; <para> <parameter>object mixed</parameter> - &false; or the object </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Meaning</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry>DB_DATAOBJECT_ERROR_NOCLASS</entry> <entry><quote>could not autoload $class</quote></entry> <entry></entry> <entry></entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.note"> &title.note; <simpara>This method must be called statically.</simpara> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.example"> &title.example; <example> <title>Simple fetch of data based on Primary Key</title> <programlisting role="php"> <![CDATA[ $person = DB_DataObject::factory('person'); if ($person->get(12)) { print_r($person); } else { echo "NO person 12 exists"; } ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/keys.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/keys.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.keys"> <refnamediv> <refname>->keys()</refname> <refpurpose>Get or set the table keys</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->keys</function></funcdef> <paramdef> array <parameter><optional>$keys</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.keys.desc"> &title.desc; <para> Without any argument, it returns the keys used by the object (the generator builds these and guess'es them based on finding things like primary key, unique, or nextval() in the description. Calling it with an array sets it for the current instance of the object. </para> <para> The default keys are is normally stored in the database.ini file described in the Autobuilding section. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.keys.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.keys.example"> &title.example; <example> <title>getting the connection</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; print_r($person->keys()); // // array( // 0 => 'id', // ) // // now use it to define a on the fly database table... $d = new DB_DataObject; $d->tableName('person'); $d->table(array( 'id' => DB_DATAOBJECT_INT, 'name' => DB_DATAOBJECT_STRING, )); $d->keys(array('id')); $d->id = 12; $d->find(true); // should do the same as above..! ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/table.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/table.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.table"> <refnamediv> <refname>->table()</refname> <refpurpose>Get or set the table schema</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->table</function></funcdef> <paramdef> array <parameter><optional>$schema</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.table.desc"> &title.desc; <para> Without any argument, it returns the table schema that the object deals with. With an array, it will set the table schema for the instance of the object. </para> <para> The default schema is normally stored in the database.ini file described in the Autobuilding section. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.table.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.table.example"> &title.example; <example> <title>getting the connection</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; print_r($person->table()); // // array( // 'id' => 1 // == DB_DATAOBJECT_INT // 'name' => 2 // == DB_DATAOBJECT_STR // 'bday' => 6 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE // 'last' => 14 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME // 'active' => 17 // == DB_DATAOBJECT_INT + DB_DATAOBJECT_BOOL // 'desc' => 34 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_TXT // 'photo' => 64 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_BLOB // ) // // now use it to define a on the fly database table... $d = new DB_DataObject; $d->tableName('person'); $d->table(array( 'id' => DB_DATAOBJECT_INT, 'name' => DB_DATAOBJECT_STRING, )); $d->keys(array('id')); $d->id = 12; $d->find(true); // should do the same as above..! ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/tablename.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/tablename.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.tablename"> <refnamediv> <refname>->tableName()</refname> <refpurpose>Get or set the table name of an object</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->tableName</function></funcdef> <paramdef> string <parameter><optional>$name</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.tablename.desc"> &title.desc; <para> Without any argument, it returns the table name that the object deals with. With a string, it will set the table name for the instance of the object. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.tablename.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.tablename.example"> &title.example; <example> <title>getting and setting the tablename</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; echo $person->tableName(); // echo's person // now use the same object to query the extra_people table $person->tableName('extra_people'); $person->id = 12; $person->find(true); // you can also use this in conjunction with table(), to create dataobjects for random tables.. $d = new DB_DataObject; $d->tableName('person'); $d->table(array( 'id' => DB_DATAOBJECT_INT, 'name' => DB_DATAOBJECT_STRING, )); $d->keys(array('id')); $d->id = 12; $d->find(true); // should do the same as above..! ]]> </programlisting> </example> </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 -->
Index: peardoc/en/package/database/db-dataobject/db-dataobject/database.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/database.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.database"> <refnamediv> <refname>->database()</refname> <refpurpose>Get or set the database the object uses</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->database</function></funcdef> <paramdef> string <parameter><optional>$name</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.database.desc"> &title.desc; <para> Without any argument, it returns the database that the object deals with. With a string, it will set the database for the instance of the object. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.database.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.database.example"> &title.example; <example> <title>Getting the database name</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; echo $person->database(); // echo's mydatabase // now use the same object to check on a mirror.. $person->database('mirror1'); $person->id = 12; $person->find(true); ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/factory.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/factory.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.factory"> <refnamediv> <refname>DB_DataObject::factory()</refname> <refpurpose>Autoload and instantate class based on table name.</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>mixed <function>DB_DataObject::factory</function></funcdef> <paramdef> string <parameter>$table</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.desc"> &title.desc; <para> This is the recommended way to autoload a class, and instantate it. The class is loaded based on the configuration settings for table to class naming. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $table</parameter> - the table you want to load </para> </listitem> <listitem> <para> <parameter>string $key</parameter> - column (or value if only 2 paramaters are given) </para> </listitem> <listitem> <para> <parameter>mixed $value</parameter> - value </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.return"> &title.returns; <para> <parameter>object mixed</parameter> - &false; or the object </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Meaning</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry>DB_DATAOBJECT_ERROR_NOCLASS</entry> <entry><quote>could not autoload $class</quote></entry> <entry></entry> <entry></entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.note"> &title.note; <simpara>This method must be called statically.</simpara> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.factory.example"> &title.example; <example> <title>Simple fetch of data based on Primary Key</title> <programlisting role="php"> <![CDATA[ $person = DB_DataObject::factory('person'); if ($person->get(12)) { print_r($person); } else { echo "NO person 12 exists"; } ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/keys.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/keys.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.keys"> <refnamediv> <refname>->keys()</refname> <refpurpose>Get or set the table keys</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->keys</function></funcdef> <paramdef> array <parameter><optional>$keys</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.keys.desc"> &title.desc; <para> Without any argument, it returns the keys used by the object (the generator builds these and guess'es them based on finding things like primary key, unique, or nextval() in the description. Calling it with an array sets it for the current instance of the object. </para> <para> The default keys are is normally stored in the database.ini file described in the Autobuilding section. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.keys.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.keys.example"> &title.example; <example> <title>getting the connection</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; print_r($person->keys()); // // array( // 0 => 'id', // ) // // now use it to define a on the fly database table... $d = new DB_DataObject; $d->tableName('person'); $d->table(array( 'id' => DB_DATAOBJECT_INT, 'name' => DB_DATAOBJECT_STRING, )); $d->keys(array('id')); $d->id = 12; $d->find(true); // should do the same as above..! ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/table.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/table.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.table"> <refnamediv> <refname>->table()</refname> <refpurpose>Get or set the table schema</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->table</function></funcdef> <paramdef> array <parameter><optional>$schema</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.table.desc"> &title.desc; <para> Without any argument, it returns the table schema that the object deals with. With an array, it will set the table schema for the instance of the object. </para> <para> The default schema is normally stored in the database.ini file described in the Autobuilding section. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.table.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.table.example"> &title.example; <example> <title>getting the connection</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; print_r($person->table()); // // array( // 'id' => 1 // == DB_DATAOBJECT_INT // 'name' => 2 // == DB_DATAOBJECT_STR // 'bday' => 6 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE // 'last' => 14 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME // 'active' => 17 // == DB_DATAOBJECT_INT + DB_DATAOBJECT_BOOL // 'desc' => 34 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_TXT // 'photo' => 64 // == DB_DATAOBJECT_STR + DB_DATAOBJECT_BLOB // ) // // now use it to define a on the fly database table... $d = new DB_DataObject; $d->tableName('person'); $d->table(array( 'id' => DB_DATAOBJECT_INT, 'name' => DB_DATAOBJECT_STRING, )); $d->keys(array('id')); $d->id = 12; $d->find(true); // should do the same as above..! ]]> </programlisting> </example> </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 --> Index: peardoc/en/package/database/db-dataobject/db-dataobject/tablename.xml +++ peardoc/en/package/database/db-dataobject/db-dataobject/tablename.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db-dataobject.db-dataobject.tablename"> <refnamediv> <refname>->tableName()</refname> <refpurpose>Get or set the table name of an object</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>object <function>$DB_DataObject->tableName</function></funcdef> <paramdef> string <parameter><optional>$name</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db-dataobject.db-dataobject.tablename.desc"> &title.desc; <para> Without any argument, it returns the table name that the object deals with. With a string, it will set the table name for the instance of the object. </para> </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.tablename.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.database.db-dataobject.db-dataobject.tablename.example"> &title.example; <example> <title>getting and setting the tablename</title> <programlisting role="php"> <![CDATA[ $person = new DataObjects_Person; echo $person->tableName(); // echo's person // now use the same object to query the extra_people table $person->tableName('extra_people'); $person->id = 12; $person->find(true); // you can also use this in conjunction with table(), to create dataobjects for random tables.. $d = new DB_DataObject; $d->tableName('person'); $d->table(array( 'id' => DB_DATAOBJECT_INT, 'name' => DB_DATAOBJECT_STRING, )); $d->keys(array('id')); $d->id = 12; $d->find(true); // should do the same as above..! ]]> </programlisting> </example> </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 -->