svn: /phpdoc/en/trunk/reference/spl/ multipleiterator/construct.xml multipleiterator.xml
| From: | Peter Cowburn | Date: | Mon, 11 Jul 2011 15:50:27 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/spl/ multipleiterator/construct.xml multipleiterator.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8458@lists.php.net to get a copy of this message | ||
salathe Mon, 11 Jul 2011 15:50:27 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313137
Log:
MultipleIterator constructor docs (patch by Gordon Oheim)
Changed paths:
U phpdoc/en/trunk/reference/spl/multipleiterator/construct.xml
U phpdoc/en/trunk/reference/spl/multipleiterator.xml
Modified: phpdoc/en/trunk/reference/spl/multipleiterator/construct.xml
===================================================================
--- phpdoc/en/trunk/reference/spl/multipleiterator/construct.xml 2011-07-11 15:48:55 UTC (rev
313136)
+++ phpdoc/en/trunk/reference/spl/multipleiterator/construct.xml 2011-07-11 15:50:27 UTC (rev
313137)
@@ -6,21 +6,24 @@
<refname>MultipleIterator::__construct</refname>
<refpurpose>Constructs a new MultipleIterator</refpurpose>
</refnamediv>
-
+
<refsect1 role="description">
&reftitle.description;
- <methodsynopsis>
+ <constructorsynopsis>
+ <modifier>public</modifier>
+ <type>void</type>
<methodname>MultipleIterator::__construct</methodname>
-
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
- </methodsynopsis>
+ <methodparam choice="opt">
+ <type>int</type>
+ <parameter>flags</parameter>
+
<initializer>MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC</initializer>
+ </methodparam>
+ </constructorsynopsis>
<para>
Construct a new MultipleIterator.
</para>
-
- &warn.undocumented.func;
-
</refsect1>
-
+
<refsect1 role="parameters">
&reftitle.parameters;
<para>
@@ -30,21 +33,30 @@
<listitem>
<para>
The flags to set, according to the
- <link linkend="multipleiterator.constants">Flag Constants</link>
+ <link linkend="multipleiterator.constants">Flag Constants</link>.
+ <simplelist>
+ <listitem>
+ <constant>MultipleIterator::MIT_NEED_ALL</constant> or
<constant>MultipleIterator::MIT_NEED_ANY</constant>
+ </listitem>
+ <listitem>
+ <constant>MultipleIterator::MIT_KEYS_NUMERIC</constant> or
<constant>MultipleIterator::MIT_KEYS_ASSOC</constant>
+ </listitem>
+ </simplelist>
</para>
+ <para> Defaults to
<constant>MultipleIterator::MIT_NEED_ALL</constant>|<constant>MultipleIterator::MIT_KEYS_NUMERIC</constant>.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
-
+
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- The iterator.
+ &return.void;
</para>
</refsect1>
-
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
@@ -54,7 +66,119 @@
</simplelist>
</para>
</refsect1>
+
+
+ <refsect1 role="examples"><!-- {{{ -->
+ &reftitle.examples;
+ <para>
+ <example xml:id="multipleiterator.example.basic"><!-- {{{ -->
+ <title>Iterating a MultipleIterator</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$people = new ArrayIterator(array('John', 'Jane', 'Jack',
'Judy'));
+$roles = new ArrayIterator(array('Developer', 'Scrum Master', 'Project
Owner'));
+$team = new MultipleIterator($flags);
+$team->attachIterator($people, 'person');
+$team->attachIterator($roles, 'role');
+
+foreach ($team as $member) {
+ print_r($member);
+}
+?>
+]]>
+ </programlisting>
+ <para xml:id="multipleiterator.examples.basic.1">Output with
<literal>$flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC</literal></para>
+ <screen>
+<![CDATA[
+Array
+(
+ [0] => John
+ [1] => Developer
+)
+Array
+(
+ [0] => Jane
+ [1] => Scrum Master
+)
+Array
+(
+ [0] => Jack
+ [1] => Project Owner
+)]]>
+ </screen>
+ <para xml:id="multipleiterator.examples.basic.2">Output with
<literal>$flags = MIT_NEED_ANY|MIT_KEYS_NUMERIC</literal></para>
+ <screen>
+<![CDATA[
+Array
+(
+ [0] => John
+ [1] => Developer
+)
+Array
+(
+ [0] => Jane
+ [1] => Scrum Master
+)
+Array
+(
+ [0] => Jack
+ [1] => Project Owner
+)
+Array
+(
+ [0] => Judy
+ [1] =>
+)]]>
+ </screen>
+ <para xml:id="multipleiterator.examples.basic.3">Output with
<literal>$flags = MIT_NEED_ALL|MIT_KEYS_ASSOC</literal></para>
+ <screen>
+<![CDATA[
+Array
+(
+ [person] => John
+ [role] => Developer
+)
+Array
+(
+ [person] => Jane
+ [role] => Scrum Master
+)
+Array
+(
+ [person] => Jack
+ [role] => Project Owner
+)]]>
+ </screen>
+ <para xml:id="multipleiterator.examples.basic.4">Output with
<literal>$flags = MIT_NEED_ANY|MIT_KEYS_NUMERIC</literal></para>
+ <screen>
+<![CDATA[
+Array
+(
+ [person] => John
+ [role] => Developer
+)
+Array
+(
+ [person] => Jane
+ [role] => Scrum Master
+)
+Array
+(
+ [person] => Jack
+ [role] => Project Owner
+)
+Array
+(
+ [person] => Judy
+ [role] =>
+)]]>
+ </screen>
+ </example><!-- }}} -->
+ </para>
+ </refsect1><!-- }}} -->
+
</refentry>
<!-- Keep this comment at the end of the file
Modified: phpdoc/en/trunk/reference/spl/multipleiterator.xml
===================================================================
--- phpdoc/en/trunk/reference/spl/multipleiterator.xml 2011-07-11 15:48:55 UTC (rev 313136)
+++ phpdoc/en/trunk/reference/spl/multipleiterator.xml 2011-07-11 15:50:27 UTC (rev 313137)
@@ -12,7 +12,7 @@
<section xml:id="multipleiterator.intro">
&reftitle.intro;
<para>
- An Iterator that iterates over several iterators at the same time.
+ An Iterator that sequentially iterates over all attached iterators
</para>
</section>
<!-- }}} -->
@@ -66,6 +66,7 @@
</fieldsynopsis>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
+ <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook)
xpointer(id('class.multipleiterator')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])"
/>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook)
xpointer(id('class.multipleiterator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])"
/>
</classsynopsis>
<!-- }}} -->