Zend_Db_Table_Abstract::__construct PHP Method

__construct() public method

Supported params for $config are: - db = user-supplied instance of database connector, or key name of registry instance. - name = table name. - primary = string or array of primary key(s). - rowClass = row class name. - rowsetClass = rowset class name. - referenceMap = array structure to declare relationship to parent tables. - dependentTables = array of child tables. - metadataCache = cache for information from adapter describeTable().
public __construct ( mixed $config = [] ) : void
$config mixed Array of user-specified config options, or just the Db Adapter.
return void
    public function __construct($config = array())
    {
        /**
         * Allow a scalar argument to be the Adapter object or Registry key.
         */
        if (!is_array($config)) {
            $config = array(self::ADAPTER => $config);
        }
        if ($config) {
            $this->setOptions($config);
        }
        $this->_setup();
        $this->init();
    }

Usage Example

Example #1
0
 public function __construct($config = null)
 {
     if (isset($this->_use_adapter)) {
         $config = $this->_use_adapter;
     }
     return parent::__construct($config);
 }
All Usage Examples Of Zend_Db_Table_Abstract::__construct