DB_DataObject::factory()

DB_DataObject::factory() -- Autoload and instantate class based on table name.

Synopsis

mixed DB_DataObject::factory (string $table)

Description

This is the recommended way to autoload a class, and instantate it. The class is loaded based on the configuration settings for table to class naming.

Parameter

Return value

object mixed - FALSE or the object

Throws

Table 26-1. Possible PEAR_Error values

Error codeError messageMeaningSolution
DB_DATAOBJECT_ERROR_NOCLASS"could not autoload $class"  

Note

This method must be called statically.

Example