1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 07:42:22 +01:00
Files
Mikhail Alferov f66b45a8ed Update Reflectionproperty to En (#1049)
* Update gethook.xml to en

* Update gethooks.xml to en

* Update getrawvalue.xml to en

* Update getsettabletype.xml to en

* Update hashook.xml to en

* Update hashooks.xml to en

* Update isfinal.xml to en

* Update isvirtual.xml to en

* Update setrawvalue.xml to en
2025-02-23 05:46:06 +03:00

121 lines
3.7 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: 79c0572a57cd5a84e9b527b40b0e07c0390e9cea Maintainer: malferov Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="reflectionproperty.getrawvalue" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionProperty::getRawValue</refname>
<refpurpose>Возвращает значение свойства в обход хука get, если такой определили</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="ReflectionProperty">
<modifier>public</modifier> <type>mixed</type><methodname>ReflectionProperty::getRawValue</methodname>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
</methodsynopsis>
&warn.undocumented.func;
<simpara>
Метод возвращает значение свойства в обход хука <literal>get</literal>, если такой хук определили.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<simpara>
Объект, из которого требуется извлечь значение.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Метод возвращает значение свойства, которое хранится в объекте, в обход хука <literal>get</literal>, если хук определили.
</simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<simpara>
При попытке получить значение виртуального свойства метод выбросит ошибку <classname>Error</classname>,
поскольку виртуальные свойства не содержат исходного значения.
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="reflectionproperty.getrawvalue.example.basic">
<title>Пример извлечения исходного значения свойства методом <methodname>ReflectionProperty::getRawValue</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
class Example
{
public string $tag {
get => strtolower($this->tag);
}
}
$example = new Example();
$example->tag = 'PHP';
$rClass = new \ReflectionClass(Example::class);
$rProp = $rClass->getProperty('tag');
// Такое обращение пройдёт через хук get, поэтому выдаст строку "php"
echo $example->tag, PHP_EOL;
echo $rProp->getValue($example), PHP_EOL;
// Но такое обращение обойдёт хук и выдаст строку "PHP"
echo $rProp->getRawValue($example);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
php
php
PHP
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><link linkend="language.oop5.visibility-members-aviz">Асимметричная видимость свойств</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
-->