Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use interface to be compatible #48

Merged

Conversation

dirkwinkhaus
Copy link

provided connection class PrimaryReadReplicaConnection is no child from \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connection. this causes issues when doing this:

$entityManager->getConnection()->prepare($sql)

therefore the implementation of the ConnectionInterface is neccessarly needed to call "prepare" on PrimaryReadReplicaConnection.

provided connection class PrimaryReadReplicaConnection is no child from \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connection. this causes issues when doing this:

    $entityManager->getConnection()->prepare($sql)

 therefore the implementation of the ConnectionInterface is neccessarly needed to call "prepare" on PrimaryReadReplicaConnection.
@dirkwinkhaus
Copy link
Author

Hey there,

when i was using the \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\PrimaryReadReplicaConnection and tried to do this:

$entityManager->getConnection()->prepare($sql);

it created an error because the connection of type \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\PrimaryReadReplicaConnection inherits Doctrine\DBAL\Connections\PrimaryReadReplicaConnection and is no member of \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connection which has to be for 2nd argument of \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Statement. Using the \Facile\DoctrineMySQLComeBack\Doctrine\DBAL\ConnectionInterface as type hint in statement will solve this.

@thomasvargiu
Copy link
Member

I'm going to merge this as an hotfix, then we're going to refactor some code for consitency.

@thomasvargiu thomasvargiu merged commit ff4a854 into facile-it:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants