mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
MultipleIterator constructor docs (patch by Gordon Oheim)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@313137 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
f6580b6a63
commit
eb887f3714
2 changed files with 138 additions and 13 deletions
|
@ -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>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue