Doctrine\DBAL\Connection::getDatabase PHP Method

getDatabase() public method

Gets the name of the database this Connection is connected to.
public getDatabase ( ) : string
return string
    public function getDatabase()
    {
        return $this->_driver->getDatabase($this);
    }

Usage Example

コード例 #1
0
 private function getTableNames()
 {
     $tableNames = [];
     foreach ($this->connection->fetchAll('SHOW TABLES') as $row) {
         $tableNames[] = $row['Tables_in_' . $this->connection->getDatabase()];
     }
     return $tableNames;
 }
All Usage Examples Of Doctrine\DBAL\Connection::getDatabase