public function createCommand($sql) { if ($this->getActive()) { return new TDbCommand($this, $sql); } else { throw new TDbException('dbconnection_connection_inactive'); } }