/** * Constructor * * This constructor will connect the driver so that methods like columnSql() and others * will fail when the driver has not been connected. * * @param AbstractDriver $driver The driver to use. */ public function __construct(AbstractDriver $driver) { if (!$driver->isConnected()) { $driver->connect(); } $this->_driver = $driver; }
/** * Returns whether connection to database server was already established. * * @return bool */ public function isConnected() { return $this->_driver->isConnected(); }