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

From: Date: Fri, 13 Jun 2008 17:57:01 +0000
Subject: cvs: peardoc /en/package/database/db-dataobject/db-dataobject setfrom.xml
Groups: php.pear.doc php.pear.doc 
Request: Send a blank email to pear-doc+get-10862@lists.php.net to get a copy of this message
moosh Fri Jun 13 17:57:01 2008 UTC Modified files: /peardoc/en/package/database/db-dataobject/db-dataobject setfrom.xml Log: no ... after etc (pleonasm) reindent http://cvs.php.net/viewvc.cgi/peardoc/en/package/database/db-dataobject/db-dataobject/setfrom.xml?r1=1.8&r2=1.9&diff_format=u Index: peardoc/en/package/database/db-dataobject/db-dataobject/setfrom.xml diff -u peardoc/en/package/database/db-dataobject/db-dataobject/setfrom.xml:1.8 peardoc/en/package/database/db-dataobject/db-dataobject/setfrom.xml:1.9 --- peardoc/en/package/database/db-dataobject/db-dataobject/setfrom.xml:1.8 Tue Dec 18 04:17:09 2007 +++ peardoc/en/package/database/db-dataobject/db-dataobject/setfrom.xml Fri Jun 13 17:57:01 2008 @@ -1,107 +1,121 @@ -<!-- $Revision: 1.8 $ --> +<?xml version="1.0" encoding="iso-8859-1" ?> +<!-- $Id: setfrom.xml,v 1.9 2008/06/13 17:57:01 moosh Exp $ --> +<!-- $Revision: 1.9 $ --> <refentry id="package.database.db-dataobject.db-dataobject.setfrom"> - <refnamediv> - <refname>-&gt;setFrom()</refname> - <refpurpose>Copy items from Array or Object (for form posting)</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcprototype> - <funcdef>boolean <function>$DB_DataObject-&gt;setFrom</function></funcdef> + <refnamediv> + <refname>-&gt;setFrom()</refname> + <refpurpose>Copy items from Array or Object (for form posting)</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcprototype> + <funcdef>boolean <function>$DB_DataObject-&gt;setFrom</function></funcdef> - <paramdef> - array or object <parameter>$from</parameter> - </paramdef> - <paramdef> - string <parameter><optional>$format = '%s'</optional></parameter> - </paramdef> - <paramdef> - bool <parameter><optional>$skipEmpty = &false;</optional></parameter> - </paramdef> - - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.desc"> - &title.desc; - <para> - Copies items that are in the table definitions from an - array or object into the current object (It will not override key values). - This can be used to process form posts (if the field names match the database), - or cloning similar objects. - </para> - <para> - you can not set the value of a key column using setFrom, It is silently ignored for - security reasons. (you can still assign it manually) - </para> - <para> - setFrom will attempt to call the setters set{columnname} methods if they exist, - It will also call fromValue(), which formats dates correctly. - </para> + <paramdef> + array or object <parameter>$from</parameter> + </paramdef> + <paramdef> + string <parameter><optional>$format = '%s'</optional></parameter> + </paramdef> + <paramdef> + bool <parameter><optional>$skipEmpty = &false;</optional></parameter> + </paramdef> + + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.desc"> + &title.desc; + <para> + Copies items that are in the table definitions from an + array or object into the current object (It will not override key values). + + This can be used to process form posts (if the field names match the database), + or cloning similar objects. + </para> + <para> + You can not set the value of a key column using setFrom, + It is silently ignored for security reasons. + + (you can still assign it manually) + </para> + <para> + setFrom will attempt to call the setters + set{columnname} methods if they exist, + It will also call fromValue(), + which formats dates correctly. + </para> - <para> - You may realize that this method overlaps the overloaded method for the column name from, - due to this, the associated methods for the column name 'from' are set_from and getFrom. - </para> - </refsect1> + <para> + You may realize that this method overlaps the overloaded method + for the column name from, due to this, + the associated methods for the column name 'from' + are set_from and getFrom. + </para> + </refsect1> - <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.parameter"> - &title.param; - <para> - <itemizedlist> + <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.parameter"> + &title.param; + <para> + <itemizedlist> + + <listitem> + <para> + <parameter>array or Object $from</parameter> + - what to copy from + </para> + </listitem> - <listitem> - <para> - <parameter>array or Object $from</parameter> - what to copy from - </para> - </listitem> + <listitem> + <para> + <parameter>string $format</parameter> + - the format of the array or object variables + and how they relate to this object. - <listitem> - <para> - <parameter>string $format</parameter> - the format of the array or object variables and how they relate to this object. - for example if your input array is in the format prefix_COLNAME, then you can use 'prefix_%s'. - </para> - </listitem> + For example if your input array is in the format prefix_COLNAME, + then you can use 'prefix_%s'. + </para> + </listitem> - <listitem> - <para> - <parameter>bool $skipEmpty</parameter> - If set to true, DB_DataObject will not assign empty values if a column is empty (eg. '' / 0 etc...) - </para> - </listitem> - </itemizedlist> + <listitem> + <para> + <parameter>bool $skipEmpty</parameter> + - If set to true, + DB_DataObject will not assign empty values + if a column is empty (eg. '' / 0 etc) + </para> + </listitem> + </itemizedlist> - </para> - </refsect1> + </para> + </refsect1> - <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.return"> - &title.returns; - <para> - <parameter>array or boolean</parameter> - &true; on success or an array of set*() return values in PHP4.3.2 upwards - </para> - </refsect1> + <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.return"> + &title.returns; + <para> + <parameter>array or boolean</parameter> + - &true; on success or an array of set*() return values in PHP4.3.2 upwards + </para> + </refsect1> - <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.note"> - &title.note; - - &note.notstatic; - - - + <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.note"> + &title.note; + &note.notstatic; <simpara></simpara> - </refsect1> + </refsect1> - <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.example"> - &title.example; - <example> - <title>Using <function>setFrom</function></title> - <programlisting role="php"> + <refsect1 id="package.database.db-dataobject.db-dataobject.setfrom.example"> + &title.example; + <example> + <title>Using <function>setFrom</function></title> + <programlisting role="php"> <![CDATA[ -// person contains name,age +// Person contains name,age // $_POST contains 'name'=>'fred', 'age'=>'22' @@ -144,10 +158,10 @@ $person->update(); ]]> - </programlisting> - </example> - </refsect1> - </refentry> + </programlisting> + </example> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml

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