mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Reverting commits r313137 and r313138 (fixing build)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@313192 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
247e4f4cab
commit
b7ff23a295
4 changed files with 24 additions and 237 deletions
|
@ -12,7 +12,7 @@
|
|||
<section xml:id="appenditerator.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Consecutively iterates over all iterators appended to this iterator.
|
||||
An Iterator that iterates over several iterators one after the other.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
@ -50,11 +50,11 @@
|
|||
<!-- }}} -->
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.appenditerator')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.appenditerator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.iteratoriterator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
|
|
|
@ -6,32 +6,33 @@
|
|||
<refname>AppendIterator::__construct</refname>
|
||||
<refpurpose>Constructs an AppendIterator</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis role="oop">
|
||||
<modifier>public</modifier>
|
||||
<type>void</type>
|
||||
<methodsynopsis>
|
||||
<methodname>AppendIterator::__construct</methodname>
|
||||
<void />
|
||||
</constructorsynopsis>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Constructs an AppendIterator.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
@ -40,96 +41,7 @@
|
|||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="examples"><!-- {{{ -->
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example xml:id="appenditerator.examples.foreach"><!-- {{{ -->
|
||||
<title>Iterating AppendIterator with foreach</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$pizzas = new ArrayIterator(array('Margarita', 'Siciliana', 'Hawaii'));
|
||||
$toppings = new ArrayIterator(array('Cheese', 'Anchovies', 'Olives', 'Pineapple', 'Ham'));
|
||||
|
||||
$appendIterator = new AppendIterator;
|
||||
$appendIterator->append($pizzas);
|
||||
$appendIterator->append($toppings);
|
||||
|
||||
foreach ($appendIterator as $key => $item) {
|
||||
echo "$key => $item", PHP_EOL;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
0 => Margarita
|
||||
1 => Siciliana
|
||||
2 => Hawaii
|
||||
0 => Cheese
|
||||
1 => Anchovies
|
||||
2 => Olives
|
||||
3 => Pineapple
|
||||
4 => Ham
|
||||
]]>
|
||||
</screen>
|
||||
</example><!-- }}} -->
|
||||
<example xml:id="appenditerator.examples.api"><!-- {{{ -->
|
||||
<title>Iterating AppendIterator with the AppendIterator API</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$pizzas = new ArrayIterator(array('Margarita', 'Siciliana', 'Hawaii'));
|
||||
$toppings = new ArrayIterator(array('Cheese', 'Anchovies', 'Olives', 'Pineapple', 'Ham'));
|
||||
|
||||
$appendIterator = new AppendIterator;
|
||||
$appendIterator->append($pizzas);
|
||||
$appendIterator->append($toppings);
|
||||
|
||||
while ($appendIterator->valid()) {
|
||||
printf(
|
||||
'%s => %s => %s%s',
|
||||
$appendIterator->getIteratorIndex(),
|
||||
$appendIterator->key(),
|
||||
$appendIterator->current(),
|
||||
PHP_EOL
|
||||
);
|
||||
$appendIterator->next();
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
0 => 0 => Margarita
|
||||
0 => 1 => Siciliana
|
||||
0 => 2 => Hawaii
|
||||
1 => 0 => Cheese
|
||||
1 => 1 => Anchovies
|
||||
1 => 2 => Olives
|
||||
1 => 3 => Pineapple
|
||||
1 => 4 => Ham
|
||||
]]>
|
||||
</screen>
|
||||
</example><!-- }}} -->
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="notes"><!-- {{{ -->
|
||||
&reftitle.notes;
|
||||
<caution>
|
||||
<para>
|
||||
When using <function>iterator_to_array</function> to copy the values of the AppendIterator
|
||||
into an array, you have to set the optional <parameter>use_key</parameter> argument to
|
||||
&false;. When <parameter>use_key</parameter> is not &false; any keys reoccuring in inner
|
||||
iterators will get overwritten in the returned array. There is no way to preserve the original keys.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1><!-- }}} -->
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<section xml:id="multipleiterator.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
An Iterator that sequentially iterates over all attached iterators
|
||||
An Iterator that iterates over several iterators at the same time.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
@ -66,7 +66,6 @@
|
|||
</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,24 +6,21 @@
|
|||
<refname>MultipleIterator::__construct</refname>
|
||||
<refpurpose>Constructs a new MultipleIterator</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<modifier>public</modifier>
|
||||
<type>void</type>
|
||||
<methodsynopsis>
|
||||
<methodname>MultipleIterator::__construct</methodname>
|
||||
<methodparam choice="opt">
|
||||
<type>int</type>
|
||||
<parameter>flags</parameter>
|
||||
<initializer>MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC</initializer>
|
||||
</methodparam>
|
||||
</constructorsynopsis>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Construct a new MultipleIterator.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
|
@ -33,30 +30,21 @@
|
|||
<listitem>
|
||||
<para>
|
||||
The flags to set, according to the
|
||||
<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>
|
||||
<link linkend="multipleiterator.constants">Flag Constants</link>
|
||||
</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>
|
||||
&return.void;
|
||||
The iterator.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
@ -66,119 +54,7 @@
|
|||
</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