mirror of
https://github.com/php/doc-fr.git
synced 2026-04-27 16:53:36 +02:00
10e7ae98f7
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@298889 c90b9560-bf6c-de11-be94-00142212c4b1
143 lines
3.4 KiB
XML
143 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 27bf45e6dfbbf90105a9fb1264c0f3d8df6ccb5f Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="reflectionclass.getproperties" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ReflectionClass::getProperties</refname>
|
|
<refpurpose>Récupère les propriétés</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>array</type><methodname>ReflectionClass::getProperties</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>filter</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Récupère les propriétés reflétées.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filter</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le filtre, optionnel, pour filtrer les types de propriiétés
|
|
désirées. Ce filtre est configuré en utilisant les
|
|
<link linkend="reflectionproperty.constants">constantes
|
|
ReflectionProperty</link>, et par défaut, tous les types de propriétés
|
|
sont retournés.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Un tableau d'objets <classname>ReflectionProperty</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="reflectionclass.getproperties.example.filter">
|
|
<title>Exemple avec <function>ReflectionClass::getProperties</function></title>
|
|
<para>
|
|
Cet exemple montre l'utilisation du paramètre optionnel
|
|
<parameter>filter</parameter>, qui permet ici de filtrer les
|
|
propriétés privées.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
class Foo {
|
|
public $foo = 1;
|
|
protected $bar = 2;
|
|
private $baz = 3;
|
|
}
|
|
|
|
$foo = new Foo();
|
|
|
|
$reflect = new ReflectionClass($foo);
|
|
$props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED);
|
|
|
|
foreach ($props as $prop) {
|
|
print $prop->getName() . "\n";
|
|
}
|
|
|
|
var_dump($props);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
foo
|
|
bar
|
|
array(2) {
|
|
[0]=>
|
|
object(ReflectionProperty)#3 (2) {
|
|
["name"]=>
|
|
string(3) "foo"
|
|
["class"]=>
|
|
string(3) "Foo"
|
|
}
|
|
[1]=>
|
|
object(ReflectionProperty)#4 (2) {
|
|
["name"]=>
|
|
string(3) "bar"
|
|
["class"]=>
|
|
string(3) "Foo"
|
|
}
|
|
}
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>ReflectionClass::getProperty</methodname></member>
|
|
<member><classname>ReflectionProperty</classname></member>
|
|
<member>Les <link linkend="reflectionproperty.constants">constantes
|
|
ReflectionProperty</link></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
|
|
-->
|