1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 08:22:08 +01:00
Files
archived-doc-es/reference/reflection/reflectionclass/getmethods.xml
Pedro Antonio Gil Rodríguez 567146163c Updated to the most recent version
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@330706 c90b9560-bf6c-de11-be94-00142212c4b1
2013-06-28 16:32:20 +00:00

180 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 24ec4b99dfa16a9dda8369a379a8734b9648538b Maintainer: seros Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="reflectionclass.getmethods" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionClass::getMethods</refname>
<refpurpose>Obtiene un array de métodos</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>ReflectionClass::getMethods</methodname>
<methodparam choice="opt"><type>int</type><parameter>filter</parameter></methodparam>
</methodsynopsis>
<para>
Obtiene un array de métodos de una clase.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filter</parameter></term>
<listitem>
<para>
Filtra los resultados para incluir solamente los métodos con ciertos atributos. Lo predeterminado
es no filtrar nada.
</para>
<para>
Cualquier combinación de <constant>ReflectionMethod::IS_STATIC</constant>,
<constant>ReflectionMethod::IS_PUBLIC</constant>,
<constant>ReflectionMethod::IS_PROTECTED</constant>,
<constant>ReflectionMethod::IS_PRIVATE</constant>,
<constant>ReflectionMethod::IS_ABSTRACT</constant>,
<constant>ReflectionMethod::IS_FINAL</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Un <type>array</type> de objetos <classname>ReflectionMethod</classname>
que reflejan cada método.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Uso básico de <methodname>ReflectionClass::getMethods</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
class Apple {
public function firstMethod() { }
final protected function secondMethod() { }
private static function thirdMethod() { }
}
$clase = new ReflectionClass('Apple');
$métodos = $clase->getMethods();
var_dump($métodos);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(3) {
[0]=>
&object(ReflectionMethod)#2 (2) {
["name"]=>
string(11) "firstMethod"
["class"]=>
string(5) "Apple"
}
[1]=>
&object(ReflectionMethod)#3 (2) {
["name"]=>
string(12) "secondMethod"
["class"]=>
string(5) "Apple"
}
[2]=>
&object(ReflectionMethod)#4 (2) {
["name"]=>
string(11) "thirdMethod"
["class"]=>
string(5) "Apple"
}
}
]]>
</screen>
</example>
</para>
<para>
<example>
<title>Filtrar los resultados de <methodname>ReflectionClass::getMethods</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
class Apple {
public function firstMethod() { }
final protected function secondMethod() { }
private static function thirdMethod() { }
}
$clase = new ReflectionClass('Apple');
$métodos = $clase->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_FINAL);
var_dump($métodos);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(2) {
[0]=>
&object(ReflectionMethod)#2 (2) {
["name"]=>
string(12) "secondMethod"
["class"]=>
string(5) "Apple"
}
[1]=>
&object(ReflectionMethod)#3 (2) {
["name"]=>
string(11) "thirdMethod"
["class"]=>
string(5) "Apple"
}
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionClass::getMethod</methodname></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
-->