Files
php-doc-ru/reference/mongodb/bson/binary/construct.xml
sergey 3881c0c892 new: mongodb bson
git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@347451 c90b9560-bf6c-de11-be94-00142212c4b1
2019-05-21 03:50:18 +00:00

150 lines
4.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: be295015d068095fc92880baef4e47038646adbd Maintainer: sergey Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="mongodb-bson-binary.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB\BSON\Binary::__construct</refname>
<refpurpose>Создает новый Binary</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>final</modifier> <modifier>public</modifier> <methodname>MongoDB\BSON\Binary::__construct</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>data</parameter> (<type>string</type>)</term>
<listitem>
<para>
Двоичные данные.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter> (<type>integer</type>)</term>
<listitem>
<para>
8-разрядное целое число, обозначающее тип данных.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<simplelist>
&mongodb.throws.argumentparsing;
<member>Выдает <classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>, если <parameter>type</parameter> не является 8-разрядным целым числом.</member>
<member>Выдает <classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>, если <parameter>type</parameter> является <constant>MongoDB\BSON\Binary::TYPE_UUID</constant> или <constant>MongoDB\BSON\Binary::TYPE_OLD_UUID</constant>, а длина <parameter>data</parameter> не равна 16 байтам.</member>
</simplelist>
</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.3.0</entry>
<entry>
<para>
<classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>
выдается, если <parameter>type</parameter> является
<constant>MongoDB\BSON\Binary::TYPE_UUID</constant> или
<constant>MongoDB\BSON\Binary::TYPE_OLD_UUID</constant>, а длина
<parameter>data</parameter> не равна 16 байтам.
</para>
</entry>
</row>
<row>
<entry>1.1.3</entry>
<entry>
<para>
<classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>
выдается, если <parameter>type</parameter> не является 8-разрядным
целым числом.
</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Пример использования <function>MongoDB\BSON\Binary::__construct</function></title>
<programlisting role="php">
<![CDATA[
<?php
$binary = new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC);
var_dump($binary);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
object(MongoDB\BSON\Binary)#1 (2) {
["data"]=>
string(3) "foo"
["type"]=>
int(0)
}
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><link xlink:href="&url.mongodb.docs.bson;">Типы BSON</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-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
-->