mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 07:02:06 +01:00
* Translate hooks reflection * Sync reflectionproperty hooks with EN * Sync propertyhooktype * Sync php example in reflectionproperty
121 lines
3.1 KiB
XML
121 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 79c0572a57cd5a84e9b527b40b0e07c0390e9cea Maintainer: Fan2Shrek Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<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>Renvoie la valeur de la propriété, en contournant un hook get si défini</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>
|
|
Renvoie la valeur d'une propriété, en contournant un hook <literal>get</literal> si défini.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>object</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
L'objet à partir duquel récupérer une valeur.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
La valeur stockée de la propriété, en contournant un hook <literal>get</literal> si défini.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<simpara>
|
|
Si la propriété est virtuelle, une <classname>Error</classname> sera lancée,
|
|
car il n'y a pas de valeur brute à récupérer.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="reflectionproperty.getrawvalue.example.basic">
|
|
<title>Exemple de <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');
|
|
|
|
// Ceci passerait par le hook get, produisant donc "php".
|
|
echo $example->tag, PHP_EOL;
|
|
echo $rProp->getValue($example), PHP_EOL;
|
|
|
|
// Mais ceci contournerait le hook et produirait "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">Visibilité de propriété asymétrique</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
|
|
-->
|