<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<refentry id="function.classkit-method-rename">
 <refnamediv>
  <refname>classkit_method_rename</refname>
  <refpurpose>Dynamically changes the name of the given method</refpurpose>
 </refnamediv>
 <refsect1>
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>classkit_method_rename</methodname>
   <methodparam><type>string</type><parameter>classname</parameter></methodparam>
   <methodparam><type>string</type><parameter>methodname</parameter></methodparam>
   <methodparam><type>string</type><parameter>newname</parameter></methodparam>
  </methodsynopsis>
  &note.classkit.selfmanipulation;
  &warn.experimental.func;
 </refsect1>
 <refsect1>
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>classname</parameter></term>
     <listitem>
      <para>
       The class in which to rename the method
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>methodname</parameter></term>
     <listitem>
      <para>
       The name of the method to rename
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>newname</parameter></term>
     <listitem>
      <para>
       The new name to give to the renamed method
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1>
  &reftitle.returnvalues;
  <para>
   &return.success;
  </para>
 </refsect1>
 <!-- No changelog: it's only in PECL. -->
 <refsect1>
  &reftitle.examples;
  <para>
   <example>
    <title><function>classkit_method_rename</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
class Example {
    function foo() {
        return "foo!\n";
    }
}

// Rename the 'foo' method to 'bar'
classkit_method_rename(
    'Example',
    'foo',
    'bar'
);

// output renamed function
echo Example::bar();
?>
]]>
    </programlisting>
    &example.outputs;
    <screen>
<![CDATA[
foo!
]]>
    </screen>
   </example>
  </para>
 </refsect1>
 <refsect1>
  &reftitle.seealso;
  <para>
   <function>classkit_method_add</function>,
   <function>classkit_method_copy</function>,
   <function>classkit_method_redefine</function>&listendand;
   <function>classkit_method_remove</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
-->