Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
6d2b649e
Unverified
Commit
6d2b649e
authored
Jul 08, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not implement driver-level interfaces by wrapper-level classes
parent
0f6b728d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
24 deletions
+19
-24
UPGRADE.md
UPGRADE.md
+4
-0
architecture.rst
docs/en/reference/architecture.rst
+1
-5
Connection.php
src/Connection.php
+10
-10
PrimaryReadReplicaConnection.php
src/Connections/PrimaryReadReplicaConnection.php
+1
-1
Connection.php
src/Portability/Connection.php
+0
-3
Statement.php
src/Statement.php
+3
-5
No files found.
UPGRADE.md
View file @
6d2b649e
# Upgrade to 3.0
## BC BREAK: Changes in the wrapper-level API ancestry
The wrapper-level
`Connection`
and
`Statement`
classes no longer implement the corresponding driver-level interfaces.
## BC BREAK: Removed DBALException factory methods
The following factory methods of the DBALException class have been removed:
...
...
docs/en/reference/architecture.rst
View file @
6d2b649e
...
...
@@ -16,11 +16,7 @@ interfaces are implemented by concrete drivers. For all PDO based
drivers, ``PDO`` and ``PDOStatement`` are the implementations of
these interfaces. Thus, for PDO-based drivers, a
``Doctrine\DBAL\Connection`` wraps a ``PDO`` instance and a
``Doctrine\DBAL\Statement`` wraps a ``PDOStatement`` instance. Even
more, a ``Doctrine\DBAL\Connection`` *is a*
``Doctrine\DBAL\Driver\Connection`` and a
``Doctrine\DBAL\Statement`` *is a*
``Doctrine\DBAL\Driver\Statement``.
``Doctrine\DBAL\Statement`` wraps a ``PDOStatement`` instance.
What does a ``Doctrine\DBAL\Connection`` or a
``Doctrine\DBAL\Statement`` add to the underlying driver
...
...
src/Connection.php
View file @
6d2b649e
...
...
@@ -41,11 +41,10 @@ use function preg_replace;
use
function
sprintf
;
/**
* A wrapper around a Doctrine\DBAL\Driver\Connection that adds features like
* events, transaction isolation levels, configuration, emulated transaction nesting,
* lazy connecting and more.
* A database abstraction-level connection that implements features like events, transaction isolation levels,
* configuration, emulated transaction nesting, lazy connecting and more.
*/
class
Connection
implements
DriverConnection
class
Connection
{
/**
* Represents an array of ints to be expanded by Doctrine SQL parsing.
...
...
@@ -757,7 +756,10 @@ class Connection implements DriverConnection
}
/**
* {@inheritDoc}
* @param mixed $input
* @param int|string $type
*
* @return mixed
*/
public
function
quote
(
$input
,
$type
=
ParameterType
::
STRING
)
{
...
...
@@ -905,11 +907,9 @@ class Connection implements DriverConnection
*
* @param string $sql The SQL statement to prepare.
*
* @return Statement
*
* @throws DBALException
*/
public
function
prepare
(
string
$sql
)
:
Driver
Statement
public
function
prepare
(
string
$sql
)
:
Statement
{
return
new
Statement
(
$sql
,
$this
);
}
...
...
@@ -1215,7 +1215,7 @@ class Connection implements DriverConnection
}
/**
*
{@inheritDoc}
*
@return bool
*/
public
function
beginTransaction
()
{
...
...
@@ -1250,7 +1250,7 @@ class Connection implements DriverConnection
}
/**
*
{@inheritDoc}
*
@return bool
*
* @throws ConnectionException If the commit failed due to no active transaction or
* because the transaction was marked for rollback only.
...
...
src/Connections/PrimaryReadReplicaConnection.php
View file @
6d2b649e
...
...
@@ -10,9 +10,9 @@ use Doctrine\DBAL\Driver;
use
Doctrine\DBAL\Driver\Connection
as
DriverConnection
;
use
Doctrine\DBAL\Driver\Exception
as
DriverException
;
use
Doctrine\DBAL\Driver\Result
;
use
Doctrine\DBAL\Driver\Statement
;
use
Doctrine\DBAL\Event\ConnectionEventArgs
;
use
Doctrine\DBAL\Events
;
use
Doctrine\DBAL\Statement
;
use
InvalidArgumentException
;
use
function
array_rand
;
...
...
src/Portability/Connection.php
View file @
6d2b649e
...
...
@@ -30,9 +30,6 @@ final class Connection implements ConnectionInterface
$this
->
converter
=
$converter
;
}
/**
* @return Statement
*/
public
function
prepare
(
string
$sql
)
:
DriverStatement
{
return
new
Statement
(
...
...
src/Statement.php
View file @
6d2b649e
...
...
@@ -3,7 +3,6 @@
namespace
Doctrine\DBAL
;
use
Doctrine\DBAL\Driver\Exception
;
use
Doctrine\DBAL\Driver\Result
as
DriverResult
;
use
Doctrine\DBAL\Driver\Statement
as
DriverStatement
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Types\Type
;
...
...
@@ -11,10 +10,9 @@ use Doctrine\DBAL\Types\Type;
use
function
is_string
;
/**
* A thin wrapper around a Doctrine\DBAL\Driver\Statement that adds support
* for logging, DBAL mapping types, etc.
* A database abstraction-level statement that implements support for logging, DBAL mapping types, etc.
*/
class
Statement
implements
DriverStatement
class
Statement
{
/**
* The SQL statement.
...
...
@@ -148,7 +146,7 @@ class Statement implements DriverStatement
*
* @throws DBALException
*/
public
function
execute
(
$params
=
null
)
:
Driver
Result
public
function
execute
(
$params
=
null
)
:
Result
{
if
(
$params
!==
null
)
{
$this
->
params
=
$params
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment