isConnected()) { $this->resource = null; } return $this; } /** * Get connection parameters * * @return array */ public function getConnectionParameters() { return $this->connectionParameters; } /** * Get driver name * * @return null|string */ public function getDriverName() { return $this->driverName; } /** * @return null|ProfilerInterface */ public function getProfiler() { return $this->profiler; } /** * {@inheritDoc} * * @return resource */ public function getResource() { if (!$this->isConnected()) { $this->connect(); } return $this->resource; } /** * Checks whether the connection is in transaction state. * * @return boolean */ public function inTransaction() { return $this->inTransaction; } /** * @param array $connectionParameters * @return self */ public function setConnectionParameters(array $connectionParameters) { $this->connectionParameters = $connectionParameters; return $this; } /** * {@inheritDoc} * * @return self */ public function setProfiler(ProfilerInterface $profiler) { $this->profiler = $profiler; return $this; } }