use Doctrine\DBAL\DriverManager; $conn = DriverManager::getConnection([ 'dbname' => 'my_db', 'user' => 'my_user', 'password' => 'my_password', 'host' => 'localhost', 'driver' => 'pdo_mysql', ]); $tableName = 'my_table'; $conn = $conn->getConnectionByTableName($tableName);In this example, we first create a connection object using the DriverManager class from Doctrine. We then specify the database name, username, password, host, and driver for the connection. Next, we specify the name of the table we want to get the connection object for using the $tableName variable. Finally, we call the getConnectionByTableName method on the connection object, passing in the table name. This method returns the connection object for the specified table. Overall, the getConnectionByTableName method is a convenient way to get the connection object for a specific table in your database using Doctrine.