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

<refentry xml:id="mongodb-bson-packedarray.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>MongoDB\BSON\PackedArray::get</refname>
  <refpurpose>Returns the value of an index in the array</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>final</modifier> <modifier>public</modifier> <type>mixed</type><methodname>MongoDB\BSON\PackedArray::get</methodname>
   <methodparam><type>int</type><parameter>key</parameter></methodparam>
  </methodsynopsis>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>key</parameter> (<type>int</type>)</term>
    <listitem>
     <para>
      The index to retrieve from the array.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the value associated with the given index. If the index is not
   present in the document, an exception is thrown.
  </para>
  <note>
   <simpara>
    When encountering a value encoded as 64-bit integer in the BSON array,
    the return value of this method will be a
    <classname>MongoDB\BSON\Int64</classname> instance.
   </simpara>
  </note>
 </refsect1>

 <refsect1 role="errors">
  &reftitle.errors;
  <simplelist>
   &mongodb.throws.argumentparsing;
   <member>Throws <classname>MongoDB\Driver\Exception\RuntimeException</classname> if the index is not present in the array.</member>
  </simplelist>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><methodname>MongoDB\BSON\PackedArray::has</methodname></member>
   <member><link xlink:href="&url.mongodb.docs.bson;">BSON Types</link></member>
  </simplelist>
 </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-packedarray: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
-->
