<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="ds-map.putall" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Ds\Map::putAll</refname>
  <refpurpose>Associates all key-value pairs of a traversable object or array</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>void</type><methodname>Ds\Map::putAll</methodname>
   <methodparam><type>mixed</type><parameter>pairs</parameter></methodparam>
  </methodsynopsis>
  <para>
    Associates all key-value <parameter>pairs</parameter> of a <classname>traversable</classname> object or &array;.
  </para>

  <note>
    <para>
        Keys of type <type>object</type> are supported.

        If an object implements <classname>Ds\Hashable</classname>,
        equality will be determined by the object's <code>equals</code> function.

        If an object does not implement <classname>Ds\Hashable</classname>,
        objects must be references to the same instance to be considered equal.
    </para>
  </note>

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>pairs</parameter></term>
    <listitem>
     <para>
        <classname>traversable</classname> object or &array;.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
    &return.void;
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><function>Ds\Map::putAll</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php
$map = new \Ds\Map();

$map->putAll([
    "a" => 1,
    "b" => 2,
    "c" => 3,
]);

print_r($map);
?>
]]>
   </programlisting>
   &example.outputs.similar;
   <screen>
<![CDATA[
Ds\Map Object
(
    [0] => Ds\Pair Object
        (
            [key] => a
            [value] => 1
        )

    [1] => Ds\Pair Object
        (
            [key] => b
            [value] => 2
        )

    [2] => Ds\Pair Object
        (
            [key] => c
            [value] => 3
        )

)
]]>
   </screen>
  </example>

 </refsect1>


</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
