1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 07:42:22 +01:00
Files
archived-doc-ru/reference/intl/dateformatter/get-error-code.xml
2024-01-19 09:46:42 +03:00

143 lines
3.6 KiB
XML
Raw Permalink 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"?>
<!-- EN-Revision: a4e79bc8e416903081feb590ce009132726a5712 Maintainer: sergey Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="intldateformatter.geterrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>IntlDateFormatter::getErrorCode</refname>
<refname>datefmt_get_error_code</refname>
<refpurpose>Получает код ошибки последней операции</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>
&style.oop;
</para>
<methodsynopsis role="IntlDateFormatter">
<modifier>public</modifier> <type>int</type><methodname>IntlDateFormatter::getErrorCode</methodname>
<void/>
</methodsynopsis>
<para>
&style.procedural;
</para>
<methodsynopsis>
<type>int</type><methodname>datefmt_get_error_code</methodname>
<methodparam><type>IntlDateFormatter</type><parameter>formatter</parameter></methodparam>
</methodsynopsis>
<para>
Возвращает код ошибки последней операции форматирования.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>formatter</parameter></term>
<listitem>
<para>
Ресурс средства форматирования.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Код ошибки, одно из значений UErrorCode. Начальное значение - U_ZERO_ERROR.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Пример использования функции <function>datefmt_get_error_code</function></title>
<programlisting role="php">
<![CDATA[
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = datefmt_format($fmt, 0);
printf(
"ОШИБКА: %s (%d)\n",
datefmt_get_error_message($fmt),
datefmt_get_error_code($fmt)
);
?>
]]>
</programlisting>
</example>
<example>
<title>Пример использования в объектно-ориентированном стиле</title>
<programlisting role="php">
<![CDATA[
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = $fmt->format(0);
printf(
"ОШИБКА: %s (%d)\n",
$fmt->getErrorMessage(),
$fmt->getErrorCode()
);
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
ОШИБКА: U_ZERO_ERROR (0)
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>datefmt_get_error_message</function></member>
<member><function>intl_get_error_code</function></member>
<member><function>intl_is_failure</function></member>
</simplelist>
</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
-->