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

[email protected] ("Brett Bieber")
Newsgroups php.pear.doc
Message-ID <cvssaltybeagle1197414076@cvsserver>
saltybeagle		Tue Dec 11 23:01:16 2007 UTC

  Modified files:              
    /peardoc/en/package/database/db-dataobject/db-dataobject	
                                                            	toarray.xml 
  Log:
  Doc Bug #11154  	Incomplete documentation
  Add documentation for the $hideEmpty parameter for the toArray() method.
  
http://cvs.php.net/viewvc.cgi/peardoc/en/package/database/db-dataobject/db-dataobject/toarray.xml?r1=1.4&r2=1.5&diff_format=u
Index: peardoc/en/package/database/db-dataobject/db-dataobject/toarray.xml
diff -u peardoc/en/package/database/db-dataobject/db-dataobject/toarray.xml:1.4 peardoc/en/package/database/db-dataobject/db-dataobject/toarray.xml:1.5
--- peardoc/en/package/database/db-dataobject/db-dataobject/toarray.xml:1.4	Sat May 26 11:39:03 2007
+++ peardoc/en/package/database/db-dataobject/db-dataobject/toarray.xml	Tue Dec 11 23:01:16 2007
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
 <refentry id="package.database.db-dataobject.db-dataobject.toarray">
    <refnamediv>
     <refname>-&gt;toArray()</refname>
@@ -14,7 +14,9 @@
        string <parameter><optional>$format</optional></parameter>
       </paramdef>
       
-      
+      <paramdef>
+       bool <parameter><optional>$hideEmpty</optional></parameter>
+      </paramdef>
                   
      </funcprototype>
     </funcsynopsis>
@@ -42,8 +44,13 @@
        <para>
         <parameter>string $format</parameter> - a sprintf string eg. 'form[%s]'
        </para>
-      </listitem>      
+      </listitem>
       
+      <listitem>
+       <para>
+        <parameter>bool $hideEmpty</parameter> - If set to true, empty elements (no value/null) will not be returned
+       </para>
+      </listitem>
             
      </itemizedlist>
     </para>
@@ -70,7 +77,8 @@
 $person->get(2);
 print_r($person->toArray());
 print_r($person->toArray('user[%s]'));
-       
+print_r($person->toArray('user[%s]', true));
+
 ]]>    
      </programlisting>
     </example>
@@ -98,6 +106,13 @@
     [user[lastname]] =>
 )
 
+Array
+(
+    [user[id]] => 2
+    [user[name]] => test
+    [user[username]] => username
+    [user[firstname]] => jones
+)
 ]]>    
      </programlisting>
     </example>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.