Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

get_parent_class(3) [php man page]

GET_PARENT_CLASS(3)							 1						       GET_PARENT_CLASS(3)

get_parent_class - Retrieves the parent class name for object or class

SYNOPSIS
string get_parent_class ([mixed $object]) DESCRIPTION
Retrieves the parent class name for object or class. PARAMETERS
o $object - The tested object or class name. This parameter is optional if called from the object's method. RETURN VALUES
Returns the name of the parent class of the class of which $object is an instance or the name. Note If the object does not have a parent or the class given does not exist FALSE will be returned. If called without parameter outside object, this function returns FALSE. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | If called without parameter outside object, this | | | function would have returned NULL with a warning, | | | but now returns FALSE. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Using get_parent_class(3) <?php class dad { function dad() { // implements some logic } } class child extends dad { function child() { echo "I'm " , get_parent_class($this) , "'s son "; } } class child2 extends dad { function child2() { echo "I'm " , get_parent_class('child2') , "'s son too "; } } $foo = new child(); $bar = new child2(); ?> The above example will output: I'm dad's son I'm dad's son too SEE ALSO
get_class(3), is_subclass_of(3). PHP Documentation Group GET_PARENT_CLASS(3)

Check Out this Related Man Page

is(n)								    [incr Tcl]								     is(n)

__________________________________________________________________________________________________________________________________________________

NAME
is - test argument to see if it is a class or an object SYNOPSIS
itcl::is option ?arg arg ...? _________________________________________________________________ DESCRIPTION
The is command is used to check if the argument given is a class or an object; depending on the option given. If the argument if a class or object, then 1 is returned. Otherwise, 0 is returned. The is command also recognizes the commands wrapped in the itcl code command. The option argument determines what action is carried out by the command. The legal options (which may be abbreviated) are: is class command Returns 1 if command is a class, and returns 0 otherwise. The fully qualified name of the class needs to be given as the command argument. So, if a class resides in a namespace, then the namespace needs to be specified as well. So, if a class C resides in a namespace N, then the command should be called like: is N::C or is ::N::C is object ?-class className? command Returns 1 if command is an object, and returns 0 otherwise. If the optional "-class" parameter is specified, then the command will be checked within the context of the class given. Note that className has to exist. If not, then an error will be given. So, if className is uncertain to be a class, then the programmer will need to check it's existance beforehand, or wrap it in a catch statement. So, if c is an object in the class C, in namespace N then these are the possibilities (all return 1): set obj [N::C c] itcl::is object N::c itcl::is object c itcl::is object $obj itcl::is object [itcl::code c] KEYWORDS
class, object itcl 3.3 is(n)
Man Page