mirror of
https://github.com/php/doc-ru.git
synced 2026-03-24 07:42:22 +01:00
* 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
111 lines
3.0 KiB
XML
111 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 366a10b130d66855054ea80d3b30e50124926a35 Maintainer: malferov Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="reflectionproperty.gethook" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ReflectionProperty::getHook</refname>
|
|
<refpurpose>Возвращает объект рефлексии хука</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="ReflectionProperty">
|
|
<modifier>public</modifier> <type class="union"><type>ReflectionMethod</type><type>null</type></type><methodname>ReflectionProperty::getHook</methodname>
|
|
<methodparam><type>PropertyHookType</type><parameter>type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Метод получает отражение хука свойства, если хук определили.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>PropertyHookType</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
Тип хука, который требуется запросить.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
Метод вернёт экземпляр класса <classname>ReflectionMethod</classname>, если запрашиваемый хук определили,
|
|
иначе вернёт &null;.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="reflectionproperty.gethook.example.basic">
|
|
<title>Пример отражения хука методом <methodname>ReflectionProperty::getHook</methodname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class Example
|
|
{
|
|
public string $name {
|
|
get => "Имя";
|
|
}
|
|
}
|
|
|
|
$rClass = new \ReflectionClass(Example::class);
|
|
$rProp = $rClass->getProperty('name');
|
|
|
|
var_dump($rProp->getHook(PropertyHookType::Get));
|
|
var_dump($rProp->getHook(PropertyHookType::Set));
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
object(ReflectionMethod)#4 (2) {
|
|
["name"]=>
|
|
string(10) "$name::get"
|
|
["class"]=>
|
|
string(7) "Example"
|
|
}
|
|
NULL
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member>Класс <classname>ReflectionMethod</classname></member>
|
|
<member>Класс <classname>PropertyHookType</classname></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
|
|
-->
|