reference/runkit7/functions/runkit7-method-copy.xml
917c06eac884740ef9285f59387a3f5259d66722
...
...
@@ -0,0 +1,136 @@
1
+
<?xml version="1.0" encoding="utf-8"?>
2
+
<!-- $Revision$ -->
3
+

4
+
<refentry xml:id="function.runkit7-method-copy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
+
<refnamediv>
6
+
<refname>runkit7_method_copy</refname>
7
+
<refpurpose>Copies a method from class to another</refpurpose>
8
+
</refnamediv>
9
+

10
+
<refsect1 role="description">
11
+
&reftitle.description;
12
+
<methodsynopsis>
13
+
<type>bool</type><methodname>runkit7_method_copy</methodname>
14
+
<methodparam><type>string</type><parameter>destination_class</parameter></methodparam>
15
+
<methodparam><type>string</type><parameter>destination_method_name</parameter></methodparam>
16
+
<methodparam><type>string</type><parameter>source_class</parameter></methodparam>
17
+
<methodparam choice="opt"><type>string</type><parameter>source_method_name</parameter></methodparam>
18
+
</methodsynopsis>
19
+
</refsect1>
20
+

21
+
<refsect1 role="parameters">
22
+
&reftitle.parameters;
23
+
<variablelist>
24
+
<varlistentry>
25
+
<term><parameter>destination_class</parameter></term>
26
+
<listitem>
27
+
<para>
28
+
Destination class for copied method
29
+
</para>
30
+
</listitem>
31
+
</varlistentry>
32
+
<varlistentry>
33
+
<term><parameter>destination_method_name</parameter></term>
34
+
<listitem>
35
+
<para>
36
+
Destination method name
37
+
</para>
38
+
</listitem>
39
+
</varlistentry>
40
+
<varlistentry>
41
+
<term><parameter>source_class</parameter></term>
42
+
<listitem>
43
+
<para>
44
+
Source class of the method to copy
45
+
</para>
46
+
</listitem>
47
+
</varlistentry>
48
+
<varlistentry>
49
+
<term><parameter>source_method_name</parameter></term>
50
+
<listitem>
51
+
<para>
52
+
Name of the method to copy from the source class. If this parameter is
53
+
omitted, the value of <parameter>destination_method_name</parameter> is assumed.
54
+
</para>
55
+
</listitem>
56
+
</varlistentry>
57
+
</variablelist>
58
+
</refsect1>
59
+

60
+
<refsect1 role="returnvalues">
61
+
&reftitle.returnvalues;
62
+
<para>
63
+
64
+
</para>
65
+
</refsect1>
66
+

67
+
<refsect1 role="examples">
68
+
&reftitle.examples;
69
+
<para>
70
+
<example>
71
+
<title><function>runkit7_method_copy</function> example</title>
72
+
<programlisting role="php">
73
+
<![CDATA[
74
+
<?php
75
+
class Foo {
76
+
function example() {
77
+
return "foo!\n";
78
+
}
79
+
}
80
+

81
+
class Bar {
82
+
// initially, no methods
83
+
}
84
+

85
+
// copy the example() method from the Foo class to the Bar class, as baz()
86
+
runkit7_method_copy('Bar', 'baz', 'Foo', 'example');
87
+

88
+
// output copied function
89
+
echo Bar::baz();
90
+
?>
91
+
]]>
92
+
</programlisting>
93
+
&example.outputs;
94
+
<screen>
95
+
<![CDATA[
96
+
foo!
97
+
]]>
98
+
</screen>
99
+
</example>
100
+
</para>
101
+
</refsect1>
102
+
<refsect1 role="seealso">
103
+
&reftitle.seealso;
104
+
<para>
105
+
<simplelist>
106
+
<member><function>runkit7_method_add</function></member>
107
+
<member><function>runkit7_method_redefine</function></member>
108
+
<member><function>runkit7_method_remove</function></member>
109
+
<member><function>runkit7_method_rename</function></member>
110
+
<member><function>runkit7_function_copy</function></member>
111
+
</simplelist>
112
+
</para>
113
+
</refsect1>
114
+

115
+
</refentry>
116
+

117
+
<!-- Keep this comment at the end of the file
118
+
Local variables:
119
+
mode: sgml
120
+
sgml-omittag:t
121
+
sgml-shorttag:t
122
+
sgml-minimize-attributes:nil
123
+
sgml-always-quote-attributes:t
124
+
sgml-indent-step:1
125
+
sgml-indent-data:t
126
+
indent-tabs-mode:nil
127
+
sgml-parent-document:nil
128
+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
129
+
sgml-exposed-tags:nil
130
+
sgml-local-catalogs:nil
131
+
sgml-local-ecat-files:nil
132
+
End:
133
+
vim600: syn=xml fen fdm=syntax fdl=2 si
134
+
vim: et tw=78 syn=sgml
135
+
vi: ts=1 sw=1
136
+
-->
0
137