classobj: switch to new style

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227213 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-01-14 15:10:19 +00:00
parent fc05600161
commit 65e3308540
15 changed files with 699 additions and 270 deletions

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.call-user-method-array">
<refnamediv>
<refname>call_user_method_array</refname>
<refpurpose>Call a user method given with an array of parameters [deprecated]</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>call_user_method_array</methodname>
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
@ -20,15 +20,14 @@
with the <literal>array(&amp;$obj, "method_name")</literal> syntax instead.
</para>
</warning>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Calls the method referred by <parameter>method_name</parameter> from
the user defined <parameter>obj</parameter> object, using the parameters
in <parameter>paramarr</parameter>.
</para>
<para>
See also:
<function>call_user_func_array</function>, and
<function>call_user_func</function>.
<simplelist>
<member><function>call_user_func_array</function></member>
<member><function>call_user_func</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.call-user-method">
<refnamediv>
<refname>call_user_method</refname>
<refpurpose>Call a user method on an specific object [deprecated]</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>call_user_method</methodname>
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
@ -21,51 +21,15 @@
with the <literal>array(&amp;$obj, "method_name")</literal> syntax instead.
</para>
</warning>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Calls the method referred by <parameter>method_name</parameter> from
the user defined <parameter>obj</parameter> object. An example of usage
is below, where we define a class, instantiate an object and use
<function>call_user_method</function> to call indirectly its
<varname>print_info</varname> method.
<simplelist>
<member><function>call_user_func_array</function></member>
<member><function>call_user_func</function></member>
</simplelist>
</para>
<para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
class Country {
var $NAME;
var $TLD;
function Country($name, $tld)
{
$this->NAME = $name;
$this->TLD = $tld;
}
function print_info($prestr = "")
{
echo $prestr . "Country: " . $this->NAME . "\n";
echo $prestr . "Top Level Domain: " . $this->TLD . "\n";
}
}
$cntry = new Country("Peru", "pe");
echo "* Calling the object method directly\n";
$cntry->print_info();
echo "\n* Calling the same method indirectly\n";
call_user_method("print_info", $cntry, "\t");
?>
]]>
</programlisting>
</informalexample>
</para>
<simpara>
See also <function>call_user_func_array</function>, and
<function>call_user_func</function>.
</simpara>
</refsect1>
</refentry>

View file

@ -1,22 +1,76 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.class-exists">
<refnamediv>
<refname>class_exists</refname>
<refpurpose>Checks if the class has been defined</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>class_exists</methodname>
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the class given by
<parameter>class_name</parameter> has been defined,
This function checks if the given class have been defined.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
The class name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>autoload</parameter></term>
<listitem>
<para>
Wether to call &link.autoload; or not by default
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if <parameter>class_name</parameter> is a defined class,
&false; otherwise.
</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.0.0</entry>
<entry>
The <parameter>autoload</parameter> was added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>class_exists</function> example</title>
@ -32,14 +86,6 @@ if (class_exists('MyClass')) {
]]>
</programlisting>
</example>
</para>
<para>
<function>class_exists</function> will attempt to call &link.autoload; by
default, if you don't want <function>class_exists</function> to
call &link.autoload;, you can set the parameter <parameter>autoload</parameter>
to &false;.
</para>
<para>
<example>
<title><parameter>autoload</parameter> parameter example</title>
<programlisting role="php">
@ -64,15 +110,15 @@ if (class_exists('MyClass')) {
</programlisting>
</example>
</para>
<note>
<para>
The <parameter>autoload</parameter> parameter was added in PHP 5
</para>
</note>
<simpara>
See also <function>interface_exists</function>, and
<function>get_declared_classes</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>interface_exists</function></member>
<member><function>get_declared_classes</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,37 +1,74 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.2 -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.get-class-methods">
<refnamediv>
<refname>get_class_methods</refname>
<refpurpose>Returns an array of class methods' names</refpurpose>
<refpurpose>Gets the class methods' names</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_class_methods</methodname>
<methodparam><type>mixed</type><parameter>class_name</parameter></methodparam>
</methodsynopsis>
<para>
This function returns an array of method names defined for the
class specified by <parameter>class_name</parameter>.
In case of an error, it returns &null;
Gets the class methods names.
</para>
<note>
<para>
As of PHP 4.0.6, you can specify the object itself instead of
<parameter>class_name</parameter>. For example:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
$class_methods = get_class_methods($my_object); // see below the full example
?>
]]>
</programlisting>
</informalexample>
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
The class name of an object instance
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of method names defined for the class specified by
<parameter>class_name</parameter>. In case of an error, it returns &null;.
</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.0.0</entry>
<entry>
As of PHP 5, this function returns the name of the methods as they
were declared (case-sensitive). In PHP 4 they were lowercased.
</entry>
</row>
<row>
<entry>4.0.6</entry>
<entry>
The ability of specifying the object itself has been added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>get_class_methods</function> example</title>
@ -80,17 +117,16 @@ myfunc2
</screen>
</example>
</para>
<warning>
<para>
As of PHP 5, this function returns the name of the methods as they were
declared (case-sensitive). In PHP 4 they were lowercased.
</para>
</warning>
<simpara>
See also <function>get_class</function>,
<function>get_class_vars</function> and
<function>get_object_vars</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_class</function></member>
<member><function>get_class_vars</function></member>
<member><function>get_object_vars</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,27 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.get-class-vars">
<refnamediv>
<refname>get_class_vars</refname>
<refpurpose>Returns an array of default properties of the class</refpurpose>
<refpurpose>Get the default properties of the class</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_class_vars</methodname>
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
</methodsynopsis>
<para>
This function will return an associative array of default public
properties of the class. The resulting array elements are in the
form of <parameter>varname => value</parameter>.
Get the default properties of the given class.
</para>
<note>
<para>
Prior to PHP 4.2.0, Uninitialized class variables will not be reported
by <function>get_class_vars</function>.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
The class name
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an associative array of default public properties of the class.
The resulting array elements are in the form of
<literal>varname => value</literal>.
</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>Prior to 4.2.0</entry>
<entry>
Uninitialized class variables will not be reported by
<function>get_class_vars</function>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>get_class_vars</function> example</title>
@ -72,10 +114,15 @@ var3 : 100
</screen>
</example>
</para>
<simpara>
See also <function>get_class_methods</function>,
<function>get_object_vars</function>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_class_methods</function></member>
<member><function>get_object_vars</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,35 +1,75 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.get-class">
<refnamediv>
<refname>get_class</refname>
<refpurpose>Returns the name of the class of an object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>get_class</methodname>
<methodparam choice="opt"><type>object</type><parameter>obj</parameter></methodparam>
<methodparam choice="opt"><type>object</type><parameter>object</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the name of the class of which the
object <parameter>obj</parameter> is an instance. Returns
&false; if <parameter>obj</parameter> is not an object.
Gets the name of the class of the given <parameter>object</parameter>.
</para>
<note>
<simpara>
A class defined in a PHP extension is returned in its original notation.
In PHP 4 <function>get_class</function> returns a user defined class
name in lowercase, but in PHP 5 it will return the class name in it's
original notation too, just like class names from PHP extensions.
</simpara>
</note>
<note>
<para>
Since PHP 5, <parameter>obj</parameter> is optional if called from the
object's method.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
The tested object
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the name of the class of which <parameter>object</parameter> is an
instance. Returns &false; if <parameter>object</parameter> is not an
object.
</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>Since 5.0.0</entry>
<entry>
The class name is returned in it's original notation.
</entry>
</row>
<row>
<entry>Since 5.0.0</entry>
<entry>
The <parameter>object</parameter> parameter is optional if called
from the object's method.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Using <function>get_class</function></title>
@ -70,10 +110,15 @@ My name is foo
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>get_parent_class</function>,
<function>gettype</function>, and
<function>is_subclass_of</function>.
<simplelist>
<member><function>get_parent_class</function></member>
<member><function>gettype</function></member>
<member><function>is_subclass_of</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,19 +1,25 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.get-declared-classes">
<refnamediv>
<refname>get_declared_classes</refname>
<refpurpose>Returns an array with the name of the defined classes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_declared_classes</methodname>
<void/>
</methodsynopsis>
<para>
This function returns an array of the names of the declared classes
in the current script.
Gets the declared classes.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of the names of the declared classes in the current
script.
</para>
<note>
<para>
@ -34,6 +40,9 @@
the appendices.
</para>
</note>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>get_declared_classes</function> example</title>
@ -57,10 +66,15 @@ Array
</screen>
</example>
</para>
<simpara>
See also <function>class_exists</function>, and
<function>get_declared_interfaces</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>class_exists</function></member>
<member><function>get_declared_interfaces</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,20 +1,29 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.get-declared-interfaces">
<refnamediv>
<refname>get_declared_interfaces</refname>
<refpurpose>Returns an array of all declared interfaces</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_declared_interfaces</methodname>
<void/>
</methodsynopsis>
<para>
This function returns an array of the names of the declared interfaces
in the current script.
Gets the declared interfaces.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of the names of the declared interfaces in the current
script.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>get_declared_interfaces</function> example</title>
@ -42,9 +51,14 @@ Array
</screen>
</example>
</para>
<simpara>
See also <function>get_declared_classes</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_declared_classes</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,28 +1,70 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.get-object-vars">
<refnamediv>
<refname>get_object_vars</refname>
<refpurpose>Returns an associative array of object properties</refpurpose>
<refpurpose>Gets the properties of the given object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_object_vars</methodname>
<methodparam><type>object</type><parameter>obj</parameter></methodparam>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
</methodsynopsis>
<para>
This function returns an associative array of defined object properties
for the specified object <parameter>obj</parameter>.
Gets the properties of the given <parameter>object</parameter>.
</para>
<note>
<para>
In versions prior to PHP 4.2.0, if the variables declared in the class
of which the <parameter>obj</parameter> is an instance, have not been
assigned a value, those will not be returned in the array. In versions
after PHP 4.2.0, the key will be assigned with a &null; value.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
An object instance.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an associative array of defined object properties for the
specified <parameter>object</parameter>. If a property have not been
assigned a value, it will be returned with a &null; value.
</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>prior to 4.2.0</entry>
<entry>
If the variables declared in the class of which the
<parameter>object</parameter> is an instance, have not been assigned a
value, those will not be returned in the array
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Use of <function>get_object_vars</function></title>
@ -82,10 +124,15 @@ print_r(get_object_vars($p1));
</screen>
</example>
</para>
<simpara>
See also <function>get_class_methods</function> and
<function>get_class_vars</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_class_methods</function></member>
<member><function>get_class_vars</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,34 +1,85 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.get-parent-class">
<refnamediv>
<refname>get_parent_class</refname>
<refpurpose>Retrieves the parent class name for object or class</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>get_parent_class</methodname>
<methodparam choice="opt"><type>mixed</type><parameter>obj</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam>
</methodsynopsis>
<para>
If <parameter>obj</parameter> is an object, returns the name of the
parent class of the class of which <parameter>obj</parameter> is an
instance.
Retrieves the parent class name for object or class.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
The tested object or class name
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the name of the parent class of the class of which
<parameter>object</parameter> is an instance or the name.
</para>
<para>
If <parameter>obj</parameter> is a string, returns the name of the parent
class of the class with that name. This functionality was added in PHP
4.0.5.
If called without parameter outside object, this function returns &false;.
</para>
<note>
<para>
Since PHP 5, <parameter>obj</parameter> is optional if called from the
object's method.
If called without parameter outside object, this function returns
&false; (or &null; with a warning before PHP 5.1.0).
</para>
</note>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>Before 5.1.0</entry>
<entry>
If called without parameter outside object, this function would have
returned &null; with a warning.
</entry>
</row>
<row>
<entry>Since 5.0.0</entry>
<entry>
The <parameter>object</parameter> parameter is optional if called
from the object's method.
</entry>
</row>
<row>
<entry>Since 4.0.5</entry>
<entry>
If <parameter>object</parameter> is a string, returns the name of the
parent class of the class with that name.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Using <function>get_parent_class</function></title>
@ -72,9 +123,14 @@ I'm dad's son too
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>get_class</function> and
<function>is_subclass_of</function>.
<simplelist>
<member><function>get_class</function></member>
<member><function>is_subclass_of</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,22 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry id="function.interface-exists">
<refnamediv>
<refname>interface_exists</refname>
<refpurpose>Checks if the interface has been defined</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>interface_exists</methodname>
<methodparam><type>string</type><parameter>interface_name</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the interface given by
<parameter>interface_name</parameter> has been defined,
&false; otherwise.
Checks if the given interface has been defined.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>interface_name</parameter></term>
<listitem>
<para>
The interface name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>autoload</parameter></term>
<listitem>
<para>
Wether to call &link.autoload; or not by default
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the interface given by
<parameter>interface_name</parameter> has been defined, &false; otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>interface_exists</function> example</title>
@ -36,15 +67,14 @@ if (interface_exists('MyInterface')) {
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<function>interface_exists</function> will attempt to call &link.autoload; by
default, if you don't want <function>interface_exists</function> to
call &link.autoload;, you can set the parameter <parameter>autoload</parameter>
to &false;.
<simplelist>
<member><function>class_exists</function></member>
</simplelist>
</para>
<simpara>
See also <function>class_exists</function>.
</simpara>
</refsect1>
</refentry>

View file

@ -1,21 +1,61 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.is-a">
<refnamediv>
<refname>is_a</refname>
<refpurpose>Returns &true; if the object is of this class or has this class as one of its parents</refpurpose>
<refpurpose>Checks if the object is of this class or has this class as one of its parents</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>is_a</methodname>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the object is of this class or
has this class as one of its parents, &false; otherwise.
Checks if the given <parameter>object</parameter> is of this class or has
this class as one of its parents.
</para>
<note>
<para>
The <function>is_a</function> function is deprecated as of PHP 5 in
favor of the <link linkend="language.operators.type">instanceof</link>
type operator.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
The tested object
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
The class name
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the object is of this class or has this class as one of
its parents, &false; otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>is_a</function> example</title>
@ -38,14 +78,6 @@ if (is_a($WF, 'WidgetFactory')) {
]]>
</programlisting>
</example>
</para>
<para>
The <function>is_a</function> function is deprecated as of PHP 5 in
favor of the <link linkend="language.operators.type">instanceof</link>
type operator. In the above example we could use the following in
PHP 5:
</para>
<para>
<example>
<title>Using the <emphasis>instanceof</emphasis> operator in PHP 5</title>
<programlisting role="php">
@ -59,11 +91,16 @@ if ($WF instanceof WidgetFactory) {
</programlisting>
</example>
</para>
<simpara>
See also <function>get_class</function>,
<function>get_parent_class</function>, and
<function>is_subclass_of</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_class</function></member>
<member><function>get_parent_class</function></member>
<member><function>is_subclass_of</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,28 +1,79 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.is-subclass-of">
<refnamediv>
<refname>is_subclass_of</refname>
<refpurpose>Returns &true; if the object has this class as one of its parents</refpurpose>
<refpurpose>Checks if the object has this class as one of its parents</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>is_subclass_of</methodname>
<methodparam><type>mixed</type><parameter>object</parameter></methodparam>
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the object
<parameter>object</parameter>, belongs to a class which is a
subclass of <parameter>class_name</parameter>, &false; otherwise.
Checks if the given <parameter>object</parameter> has the class
<parameter>class_name</parameter> as one of its parents.
</para>
<note>
<para>
Since PHP 5.0.3 you may also specify the <parameter>object</parameter>
parameter as a string (the name of the class).
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
A class name or an object instance
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
The class name
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This function returns &true; if the object <parameter>object</parameter>,
belongs to a class which is a subclass of
<parameter>class_name</parameter>, &false; otherwise.
</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.0.3</entry>
<entry>
You may also specify the <parameter>object</parameter> parameter as a
string (the name of the class)
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>is_subclass_of</function> example</title>
@ -78,11 +129,16 @@ yes, WidgetFactory_Child is a subclass of WidgetFactory
</screen>
</example>
</para>
<simpara>
See also <function>get_class</function>,
<function>get_parent_class</function> and
<function>is_a</function>.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_class</function></member>
<member><function>get_parent_class</function></member>
<member><function>is_a</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,22 +1,55 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.method-exists">
<refnamediv>
<refname>method_exists</refname>
<refpurpose>Checks if the class method exists</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>method_exists</methodname>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the method given by
<parameter>method_name</parameter> has been defined for the given
<parameter>object</parameter>, &false; otherwise.
Checks if the class method exists in the given
<parameter>object</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
An object instance
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>method_name</parameter></term>
<listitem>
<para>
The method name
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the method given by <parameter>method_name</parameter>
has been defined for the given <parameter>object</parameter>, &false;
otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>method_exists</function> example</title>
@ -36,9 +69,14 @@ bool(true)
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>function_exists</function> and
<function>is_callable</function>.
<simplelist>
<member><function>function_exists</function></member>
<member><function>is_callable</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.property-exists">
<refnamediv>
<refname>property_exists</refname>
@ -34,7 +34,7 @@
<term><parameter>class</parameter></term>
<listitem>
<para>
A string with the class name or an object of the class to test for
The class name or an object of the class to test for
</para>
</listitem>
</varlistentry>