DboSource::__construct PHP Method

__construct() public method

Constructor
public __construct ( array $config = null, boolean $autoConnect = true )
$config array Array of configuration information for the Datasource.
$autoConnect boolean Whether or not the datasource should automatically connect.
    public function __construct($config = null, $autoConnect = true)
    {
        if (!isset($config['prefix'])) {
            $config['prefix'] = '';
        }
        parent::__construct($config);
        $this->fullDebug = Configure::read('debug') > 1;
        if (!$this->enabled()) {
            throw new MissingConnectionException(array('class' => get_class($this), 'message' => __d('cake_dev', 'Selected driver is not enabled'), 'enabled' => false));
        }
        if ($autoConnect) {
            $this->connect();
        }
    }

Usage Example

 /**
  * construct method
  *
  * By default don't try to connect until you need to
  *
  * @param array $config Configuration array
  * @param bool $autoConnect false
  * @return void
  * @access public
  */
 function __construct($config = array(), $autoConnect = false) {
     return parent::__construct($config, $autoConnect);
 }
All Usage Examples Of DboSource::__construct
DboSource