laravel-doctrine / orm

A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen

Home Page:http://laraveldoctrine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] PrimaryReadReplica doesn't work

gierappa opened this issue · comments

Function hasValidPrimaryReadReplicaConfig is a void function throwing only exceptions so if statement does not work.

if ($this->isPrimaryReadReplicaConfigured($driver)) {
    if($this->hasValidPrimaryReadReplicaConfig($driver)) {
        $connection_configuration = (new PrimaryReadReplicaConnection($this->config, $connection_configuration))->resolve($driver);
    }
}

Proposal:

if ($this->isPrimaryReadReplicaConfigured($driver)) {
    $this->hasValidPrimaryReadReplicaConfig($driver);
    $connection_configuration = (new PrimaryReadReplicaConnection($this->config, $connection_configuration))->resolve($driver);
}