<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionclass.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'reflectionclass.getproperties.php',
    1 => 'ReflectionClass::getProperties',
    2 => 'R&eacute;cup&egrave;re les propri&eacute;t&eacute;s',
  ),
  'up' => 
  array (
    0 => 'class.reflectionclass.php',
    1 => 'ReflectionClass',
  ),
  'prev' => 
  array (
    0 => 'reflectionclass.getparentclass.php',
    1 => 'ReflectionClass::getParentClass',
  ),
  'next' => 
  array (
    0 => 'reflectionclass.getproperty.php',
    1 => 'ReflectionClass::getProperty',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/reflection/reflectionclass/getproperties.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionclass.getproperties" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionClass::getProperties</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionClass::getProperties</span> &mdash; <span class="dc-title">Récupère les propriétés</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionclass.getproperties-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionClass::getProperties</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$filter</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Récupère les propriétés reflétées.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionclass.getproperties-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filter</code></dt>
     <dd>
      <p class="para">
       Le filtre, optionnel, pour filtrer les types de propriétés
       désirées. Ce filtre est configuré en utilisant les
       <a href="class.reflectionproperty.php#reflectionproperty.constants.modifiers" class="link">constantes
        ReflectionProperty</a>, et par défaut, tous les types de propriétés
       sont retournés.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionclass.getproperties-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Un tableau d&#039;objets <span class="classname"><a href="class.reflectionproperty.php" class="classname">ReflectionProperty</a></span>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-reflectionclass.getproperties-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>7.2.0</td>
      <td>
       <code class="parameter">filter</code> est désormais nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-reflectionclass.getproperties-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="reflectionclass.getproperties.example.filter">
   <p><strong>Exemple #1 Exemple avec <span class="function"><strong>ReflectionClass::getProperties()</strong></span></strong></p>
   <div class="example-contents"><p>
    Cet exemple montre l&#039;utilisation du paramètre optionnel
    <code class="parameter">filter</code>, qui permet ici de filtrer les
    propriétés privées.
   </p></div>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">Foo </span><span style="color: #007700">{<br />    public    </span><span style="color: #0000BB">$foo  </span><span style="color: #007700">= </span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />    protected </span><span style="color: #0000BB">$bar  </span><span style="color: #007700">= </span><span style="color: #0000BB">2</span><span style="color: #007700">;<br />    private   </span><span style="color: #0000BB">$baz  </span><span style="color: #007700">= </span><span style="color: #0000BB">3</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$foo </span><span style="color: #007700">= new </span><span style="color: #0000BB">Foo</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$reflect </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionClass</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$props   </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflect</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getProperties</span><span style="color: #007700">(</span><span style="color: #0000BB">ReflectionProperty</span><span style="color: #007700">::</span><span style="color: #0000BB">IS_PUBLIC </span><span style="color: #007700">| </span><span style="color: #0000BB">ReflectionProperty</span><span style="color: #007700">::</span><span style="color: #0000BB">IS_PROTECTED</span><span style="color: #007700">);<br /><br />foreach (</span><span style="color: #0000BB">$props </span><span style="color: #007700">as </span><span style="color: #0000BB">$prop</span><span style="color: #007700">) {<br />    print </span><span style="color: #0000BB">$prop</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getName</span><span style="color: #007700">() . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$props</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">foo
bar
array(2) {
  [0]=&gt;
  object(ReflectionProperty)#3 (2) {
    [&quot;name&quot;]=&gt;
    string(3) &quot;foo&quot;
    [&quot;class&quot;]=&gt;
    string(3) &quot;Foo&quot;
  }
  [1]=&gt;
  object(ReflectionProperty)#4 (2) {
    [&quot;name&quot;]=&gt;
    string(3) &quot;bar&quot;
    [&quot;class&quot;]=&gt;
    string(3) &quot;Foo&quot;
  }
}</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionclass.getproperties-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="reflectionclass.getproperty.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::getProperty()</a> - R&eacute;cup&egrave;re une ReflectionProperty pour une propri&eacute;t&eacute; d'une classe</span></li>
    <li><span class="classname"><a href="class.reflectionproperty.php" class="classname">ReflectionProperty</a></span></li>
    <li>Les <a href="class.reflectionproperty.php#reflectionproperty.constants.modifiers" class="link">constantes
     de modificateurs de ReflectionProperty</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>