mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-28 11:13:14 +02:00
2c96c77f4e
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@186257 c90b9560-bf6c-de11-be94-00142212c4b1
92 lines
2.1 KiB
XML
92 lines
2.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.10 $ -->
|
|
<!-- EN-Revision: 1.6 Maintainer: dams Status: ready -->
|
|
<refentry id="function.get-parent-class">
|
|
<refnamediv>
|
|
<refname>get_parent_class</refname>
|
|
<refpurpose>Retourne le nom de la classe d'un objet</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>get_parent_class</methodname>
|
|
<methodparam><type>mixed</type><parameter>obj</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>get_parent_class</function> retourne le nom de la classe
|
|
de l'objet <parameter>obj</parameter>.
|
|
</para>
|
|
<para>
|
|
Si le paramètre <parameter>obj</parameter> est une chaîne,
|
|
<function>get_parent_class</function> retourne le nom de la classe
|
|
parente. Cette fonctionnalité a été ajoutée en &php; 4.0.5.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>get_parent_class</function></title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class papa {
|
|
function papa() {
|
|
// un peu de code
|
|
}
|
|
}
|
|
|
|
class child extends papa {
|
|
function child() {
|
|
echo "je suis le fils de " , get_parent_class($this) , "\n";
|
|
}
|
|
}
|
|
|
|
class child2 extends papa {
|
|
function child2() {
|
|
echo "Je suis aussi le papa de " , get_parent_class('child2') , "\n";
|
|
}
|
|
}
|
|
|
|
$foo = new child();
|
|
$bar = new child2();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
je suis le fils de papa
|
|
Je suis aussi le papa de papa
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>get_class</function> et
|
|
<function>is_subclass_of</function>.
|
|
</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:"../../../../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
|
|
-->
|