CachingIterator::getCache()

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@333177 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Peter Cowburn 2014-03-29 21:53:53 +00:00
parent d67e339dea
commit 3ecf580903

View file

@ -4,18 +4,24 @@
<refentry xml:id="cachingiterator.getcache" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>CachingIterator::getCache</refname>
<refpurpose>The getCache purpose</refpurpose>
<refpurpose>Retrieve the contents of the cache</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>CachingIterator::getCache</methodname>
<modifier>public</modifier> <type>array</type><methodname>CachingIterator::getCache</methodname>
<void />
</methodsynopsis>
&warn.undocumented.func;
<para>
Retrieve the contents of the cache.
</para>
<note>
<para>
The <constant>CachingIterator::FULL_CACHE</constant> flag
must be being used.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
@ -26,7 +32,58 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Description...
An <type>array</type> containing the cache items.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws a <classname>BadMethodCallException</classname> when the
<constant>CachingIterator::FULL_CACHE</constant> flag is not being used.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><methodname>CachingIterator::getCache</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
$iterator = new ArrayIterator(array(1, 2, 3));
$cache = new CachingIterator($iterator, CachingIterator::FULL_CACHE);
$cache->next();
$cache->next();
var_dump($cache->getCache());
$cache->next();
var_dump($cache->getCache());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
]]>
</screen>
</example>
</para>
</refsect1>