mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Method synopses and IDs for magic methods and function
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@322132 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
065dd47a92
commit
bc09a56fb5
5 changed files with 45 additions and 14 deletions
|
@ -2,6 +2,10 @@
|
|||
<!-- $Revision$ -->
|
||||
<sect1 xml:id="language.oop5.autoload" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>Autoloading Classes</title>
|
||||
<methodsynopsis xml:id="function.autoload">
|
||||
<type>void</type><methodname>__autoload</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Many developers writing object-oriented applications create
|
||||
one PHP source file per-class definition. One of the biggest
|
||||
|
|
|
@ -36,6 +36,11 @@ $copy_of_object = clone $object;
|
|||
will remain references.
|
||||
</para>
|
||||
|
||||
<methodsynopsis xml:id="object.clone">
|
||||
<type>void</type><methodname>__clone</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
Once the cloning is complete, if a <link linkend="language.oop5.cloning">__clone()</link> method is defined, then
|
||||
the newly created object's <link linkend="language.oop5.cloning">__clone()</link> method will be called, to allow any
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<sect2 xml:id="language.oop5.decon.constructor">
|
||||
<title>Constructor</title>
|
||||
<methodsynopsis>
|
||||
<methodsynopsis xml:id="object.construct">
|
||||
<type>void</type><methodname>__construct</methodname>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam>
|
||||
<methodparam choice="opt"><parameter>...</parameter></methodparam>
|
||||
|
@ -87,7 +87,7 @@ class Bar {
|
|||
|
||||
<sect2 xml:id="language.oop5.decon.destructor">
|
||||
<title>Destructor</title>
|
||||
<methodsynopsis>
|
||||
<methodsynopsis xml:id="object.destruct">
|
||||
<type>void</type><methodname>__destruct</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
|
|
|
@ -37,6 +37,16 @@
|
|||
<link linkend="language.oop5.magic.sleep">__sleep()</link> and
|
||||
<link linkend="language.oop5.magic.sleep">__wakeup()</link>
|
||||
</title>
|
||||
|
||||
<methodsynopsis xml:id="object.sleep">
|
||||
<modifier>public</modifier> <type>array</type><methodname>__sleep</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis xml:id="object.wakeup">
|
||||
<type>void</type><methodname>__wakeup</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<function>serialize</function> checks if your class has a function with
|
||||
the magic name <link linkend="language.oop5.magic.sleep">__sleep()</link>. If so, that function is
|
||||
|
@ -115,6 +125,10 @@ class Connection
|
|||
|
||||
<sect2 xml:id="language.oop5.magic.tostring">
|
||||
<title><link linkend="language.oop5.magic.tostring">__toString()</link></title>
|
||||
<methodsynopsis xml:id="object.tostring">
|
||||
<modifier>public</modifier> <type>string</type><methodname>__toString</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <link linkend="language.oop5.magic.tostring">__toString()</link> method allows a class to decide
|
||||
how it will react when it is treated like a string. For example,
|
||||
|
@ -169,6 +183,10 @@ Hello
|
|||
|
||||
<sect2 xml:id="language.oop5.magic.invoke">
|
||||
<title><link linkend="language.oop5.magic.invoke">__invoke()</link></title>
|
||||
<methodsynopsis xml:id="object.invoke">
|
||||
<type>mixed</type><methodname>__invoke</methodname>
|
||||
<methodparam choice="opt"><parameter>...</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <link linkend="language.oop5.magic.invoke">__invoke()</link> method is called when a script tries to
|
||||
call an object as a function.
|
||||
|
@ -208,6 +226,10 @@ bool(true)
|
|||
|
||||
<sect2 xml:id="language.oop5.magic.set-state">
|
||||
<title><link linkend="language.oop5.magic.set-state">__set_state()</link></title>
|
||||
<methodsynopsis xml:id="object.set-state">
|
||||
<modifier>static</modifier> <type>object</type><methodname>__set_state</methodname>
|
||||
<methodparam><type>array</type><parameter>properties</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This <link linkend="language.oop5.static">static</link> method is called
|
||||
for classes exported by <function>var_export</function> since PHP 5.1.0.
|
||||
|
|
|
@ -78,21 +78,21 @@
|
|||
<sect2 xml:id="language.oop5.overloading.members">
|
||||
<title>Property overloading</title>
|
||||
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>__set</methodname>
|
||||
<methodsynopsis xml:id="object.set">
|
||||
<modifier>public</modifier> <type>void</type><methodname>__set</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>__get</methodname>
|
||||
<methodsynopsis xml:id="object.get">
|
||||
<modifier>public</modifier> <type>mixed</type><methodname>__get</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>__isset</methodname>
|
||||
<methodsynopsis xml:id="object.isset">
|
||||
<modifier>public</modifier> <type>bool</type><methodname>__isset</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>__unset</methodname>
|
||||
<methodsynopsis xml:id="object.unset">
|
||||
<modifier>public</modifier> <type>void</type><methodname>__unset</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
|
@ -276,13 +276,13 @@ Notice: Undefined property via __get(): hidden in <file> on line 70 in <file> o
|
|||
<sect2 xml:id="language.oop5.overloading.methods">
|
||||
<title>Method overloading</title>
|
||||
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>__call</methodname>
|
||||
<methodsynopsis xml:id="object.call">
|
||||
<modifier>public</modifier> <type>mixed</type><methodname>__call</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>arguments</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>__callStatic</methodname>
|
||||
<methodsynopsis xml:id="object.callstatic">
|
||||
<modifier>public static</modifier> <type>mixed</type><methodname>__callStatic</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>arguments</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
|
Loading…
Reference in a new issue