mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 15:12:13 +01:00
159 lines
4.6 KiB
XML
159 lines
4.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: c7fbc342dffb14f19f84b5ba8883624b69df5262 Maintainer: yannick 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>Construit un nouveau binaire</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 choice="opt"><type>int</type><parameter>type</parameter><initializer>MongoDB\BSON\Binary::TYPE_GENERIC</initializer></methodparam>
|
|
</methodsynopsis>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter> (<type>string</type>)</term>
|
|
<listitem>
|
|
<para>
|
|
Les données binaires.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>type</parameter> (<type>int</type>)</term>
|
|
<listitem>
|
|
<para>
|
|
Entier 8 bits non signé indiquant le type de données. Par défaut,
|
|
la valeur est <constant>MongoDB\BSON\Binary::TYPE_GENERIC</constant> si elle n'est pas spécifiée.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<simplelist>
|
|
&mongodb.throws.argumentparsing;
|
|
<member>Lève une exception <classname>MongoDB\Driver\Exception\InvalidArgumentException</classname> si <parameter>type</parameter> n'est pas un entier non signé de 8 bits.</member>
|
|
<member>Lève une exception <classname>MongoDB\Driver\Exception\InvalidArgumentException</classname> si <parameter>type</parameter> est <constant>MongoDB\BSON\Binary::TYPE_UUID</constant> ou <constant>MongoDB\BSON\Binary::TYPE_OLD_UUID</constant> et <parameter>data</parameter> n'a pas exactement 16 octets de longueur.</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>PECL mongodb 1.15.0</entry>
|
|
<entry>
|
|
<para>
|
|
Le paramètre <parameter>type</parameter> est désormais facultatif
|
|
et a pour valeur par défaut <constant>MongoDB\BSON\Binary::TYPE_GENERIC</constant> s'il n'est pas spécifié.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>PECL mongodb 1.3.0</entry>
|
|
<entry>
|
|
<para>
|
|
<classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>
|
|
est levée si <parameter>type</parameter> est
|
|
<constant>MongoDB\BSON\Binary::TYPE_UUID</constant> ou
|
|
<constant>MongoDB\BSON\Binary::TYPE_OLD_UUID</constant> et
|
|
<parameter>data</parameter> n'a pas exactement 16 octets de longueur.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>PECL mongodb 1.1.3</entry>
|
|
<entry>
|
|
<para>
|
|
<classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>
|
|
est levée si <parameter>type</parameter> n'est pas un entier non signé
|
|
de 8 bits.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Exemple avec <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;">Les types 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
|
|
-->
|