Prev | Current Page 257 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

Its prototype
follows:
array get_declared_classes(void)
Learning About Object Fields
The function get_object_vars() returns an associative array containing the defined
fields available to object and their corresponding values. Those fields that don??™t possess
a value will be assigned NULL within the associative array. Its prototype follows:
array get_object_vars(object object)
Determining an Object??™s Parent Class
The get_parent_class() function returns the name of the parent of the class to which
object belongs. If object??™s class is a base class, that class name will be returned. Its
prototype follows:
string get_parent_class(mixed object)
CHAPTER 6 ?–  O BJECT-ORIENTED PHP 191
Determining Interface Existence
The interface_exists() function determines whether an interface exists, returning
TRUE if it does, and FALSE otherwise. Its prototype follows:
boolean interface_exists(string interface_name [, boolean autoload])
Determining Object Type
The is_a() function returns TRUE if object belongs to a class of type class_name or if
it belongs to a class that is a child of class_name. If object bears no relation to the
class_name type, FALSE is returned. Its prototype follows:
boolean is_a(object object, string class_name)
Determining Object Subclass Type
The is_subclass_of() function returns TRUE if object belongs to a class inherited
from class_name, and returns FALSE otherwise.


Pages:
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269