/**
  * Constructor.
  *
  * @param array $config Array of user-specified config options.
  */
 public function __construct($config = null)
 {
     // set a custom Zend_Db_Adapter connection
     if (!empty($config['db'])) {
         // convenience variable
         $db = $config['db'];
         // use an object from the registry?
         if (is_string($db)) {
             $db = Zend::registry($db);
         }
         // make sure it's a Zend_Db_Adapter
         if (!$db instanceof Zend_Db_Adapter_Abstract) {
             throw new Zend_Db_Table_Exception('db object does not implement Zend_Db_Adapter_Abstract');
         }
         // save the connection
         $this->_db = $db;
     }
     // set the inflector
     self::$_inflector = new Zend_Db_Inflector();
     // continue with automated setup
     $this->_setup();
 }