mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@334597 c90b9560-bf6c-de11-be94-00142212c4b1
152 lines
3.5 KiB
XML
152 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: afc3f34c682418a582b0f9199db0bac4a087821f Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.get-parent-class" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>get_parent_class</refname>
|
|
<refpurpose>Recupera el nombre de la clase padre de un objeto o clase</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>get_parent_class</methodname>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Recupera el nombre de la clase padre de un objeto o clase.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>object</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El objeto evaluádo o nombre de la clase. Este parámetro es opcional si se invoca
|
|
desde el método del objeto.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el nombre de la clase padre de la clase de la cuál
|
|
<parameter>object</parameter> es una instancia o el nombre.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Si el objeto no tiene padre o la clase dada no existe devolverá &false;.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Si se llama sin parámetro fuera del objeto, esta función devolverá &false;.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.1.0</entry>
|
|
<entry>
|
|
Si se llamaba sin parámetro fuera del objeto, está función devolvía
|
|
&null; con una advertencia, pero ahora devuelve &false;.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Usar <function>get_parent_class</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class papá {
|
|
function papá()
|
|
{
|
|
// implementar algo lógico
|
|
}
|
|
}
|
|
|
|
class hijo extends papá {
|
|
function hijo()
|
|
{
|
|
echo "Soy hijo de " , get_parent_class($this) , "\n";
|
|
}
|
|
}
|
|
|
|
class hijo2 extends papá {
|
|
function hijo2()
|
|
{
|
|
echo "Yo también soy hijo de " , get_parent_class('hijo2') , "\n";
|
|
}
|
|
}
|
|
|
|
$foo = new hijo();
|
|
$bar = new hijo2();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
I'm dad's son
|
|
I'm dad's son too
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>get_class</function></member>
|
|
<member><function>is_subclass_of</function></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
|
|
-->
|