<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>The Collection interface</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ds.examples.html">Examples</a></div> <div class="next" style="text-align: right; float: right;"><a href="ds-collection.clear.html">Ds\Collection::clear</a></div> <div class="up"><a href="book.ds.html">Data Structures</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.ds-collection" class="reference"> <h1 class="title">The Collection interface</h1> <div class="partintro"><p class="verinfo">(No version information available, might only be in Git)</p> <div class="section" id="ds-collection.intro"> <h2 class="title">Introduction</h2> <p class="para"> <strong class="classname">Collection</strong> is the base interface which covers functionality common to all the data structures in this library. It guarantees that all structures are traversable, countable, and can be converted to json using <span class="function"><a href="function.json-encode.html" class="function">json_encode()</a></span>. </p> </div> <div class="section" id="ds-collection.synopsis"> <h2 class="title">Interface synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"><strong class="classname">Ds\Collection</strong></span> <span class="oointerface">implements <span class="interfacename"><a href="class.traversable.html" class="interfacename">Traversable</a></span></span> <span class="oointerface">, <span class="interfacename"><a href="class.countable.html" class="interfacename">Countable</a></span></span> <span class="oointerface">, <span class="interfacename"><a href="class.jsonserializable.html" class="interfacename">JsonSerializable</a></span></span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="ds-collection.clear.html" class="methodname">clear</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">Ds\Collection</span> <span class="methodname"><a href="ds-collection.copy.html" class="methodname">copy</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="ds-collection.isempty.html" class="methodname">isEmpty</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="ds-collection.toarray.html" class="methodname">toArray</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="ds-collection.clear.html">Ds\Collection::clear</a> — Removes all values</li><li><a href="ds-collection.copy.html">Ds\Collection::copy</a> — Returns a shallow copy of the collection</li><li><a href="ds-collection.isempty.html">Ds\Collection::isEmpty</a> — Returns whether the collection is empty</li><li><a href="ds-collection.toarray.html">Ds\Collection::toArray</a> — Converts the collection to an array</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ds.examples.html">Examples</a></div> <div class="next" style="text-align: right; float: right;"><a href="ds-collection.clear.html">Ds\Collection::clear</a></div> <div class="up"><a href="book.ds.html">Data Structures</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>