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

MasterSlaveConnection implements MasterSlaveConnectionInterface in or… #2890

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
* @author Lars Strojny <[email protected]>
* @author Benjamin Eberlei <[email protected]>
*/
class MasterSlaveConnection extends Connection
class MasterSlaveConnection extends Connection implements MasterSlaveConnectionInterface
{
/**
* Master and slave connection (one of the randomly picked slaves).
Expand Down Expand Up @@ -127,9 +127,7 @@ public function __construct(array $params, Driver $driver, Configuration $config
}

/**
* Checks if the connection is currently towards the master or not.
*
* @return boolean
* {@inheritdoc}
*/
public function isConnectedToMaster()
{
Expand Down
37 changes: 37 additions & 0 deletions lib/Doctrine/DBAL/Connections/MasterSlaveConnectionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\DBAL\Connections;

use Doctrine\DBAL\Driver\Connection;

/**
* Class MasterSlaveConnectionInterface
* @package Doctrine\DBAL\Connections
* @author Tocila Ionut <[email protected]>
*/
interface MasterSlaveConnectionInterface extends Connection
{
/**
* Checks if the connection is currently towards the master or not.
*
* @return boolean
*/
public function isConnectedToMaster();
}