php-doc-en/reference/mongo/mongobindata/construct.xml
2014-03-10 15:03:19 +00:00

121 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="mongobindata.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoBinData::__construct</refname>
<refpurpose>Creates a new binary data object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <methodname>MongoBinData::__construct</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Creates a new binary data object.
</para>
<para>
There are seven types of binary data currently recognized by the BSON spec,
which are defined as
<link linkend="mongobindata.constants.types">class constants</link>. For
backwards compatibility, the PHP driver uses
<constant>MongoBinData::BYTE_ARRAY</constant> as the default; however, this
may change to <constant>MongoBinData::GENERIC</constant> in the future.
Users are encouraged to specify a type instead of relying on the default.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>data</parameter>
</term>
<listitem>
<para>
Binary data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>type</parameter>
</term>
<listitem>
<para>
Data type.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new binary data object.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>1.5.0</entry>
<entry>
The default changed from <literal>2</literal>
(<constant>MongoBinData::BYTE_ARRAY</constant>) to
<literal>0</literal> (<constant>MongoBinData::GENERIC</constant>).
</entry>
</row>
<row>
<entry>1.2.11</entry>
<entry>
Emits <constant>E_DEPRECATED</constant> when the second argument is not
used. The default value for <parameter>type</parameter> may change in
the near future.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</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
-->