2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-02-24 08:42:32 +00:00
|
|
|
<!-- $Revision: 1.5 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.33 -->
|
|
|
|
<refentry id="function.is-a">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>is_a</refname>
|
|
|
|
<refpurpose>
|
2002-05-30 14:02:40 +00:00
|
|
|
Returns &true; if the object is of this class or has this class as
|
2002-04-15 00:12:54 +00:00
|
|
|
one of its parents
|
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<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.
|
|
|
|
</para>
|
2004-02-24 05:54:36 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
2004-02-24 08:42:32 +00:00
|
|
|
<title><function>is_a</function> example</title>
|
2004-02-24 05:54:36 +00:00
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
// define a class
|
|
|
|
class WidgetFactory
|
|
|
|
{
|
|
|
|
var $oink = 'moo';
|
|
|
|
}
|
|
|
|
|
|
|
|
// create a new object
|
|
|
|
$WF = new WidgetFactory();
|
|
|
|
|
2004-02-24 08:42:32 +00:00
|
|
|
if (is_a($WF, 'WidgetFactory')) {
|
|
|
|
echo "yes, $WF is still a WidgetFactory\n";
|
2004-02-24 05:54:36 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2002-04-15 00:12:54 +00:00
|
|
|
<simpara>
|
|
|
|
See also <function>get_class</function>,
|
|
|
|
<function>get_parent_class</function>, and
|
|
|
|
<function>is_subclass_of</function>.
|
|
|
|
</simpara>
|
|
|
|
</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
|
|
|
|
-->
|