Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7416970
AbstractConnectionMiddleware.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
AbstractConnectionMiddleware.php
View Options
<?php
namespace
Doctrine\DBAL\Driver\Middleware
;
use
Doctrine\DBAL\Driver\Connection
;
use
Doctrine\DBAL\Driver\Result
;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\Driver\Statement
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\Deprecations\Deprecation
;
use
LogicException
;
use
function
get_class
;
use
function
method_exists
;
use
function
sprintf
;
abstract
class
AbstractConnectionMiddleware
implements
ServerInfoAwareConnection
{
private
Connection
$wrappedConnection
;
public
function
__construct
(
Connection
$wrappedConnection
)
{
$this
->
wrappedConnection
=
$wrappedConnection
;
}
public
function
prepare
(
string
$sql
):
Statement
{
return
$this
->
wrappedConnection
->
prepare
(
$sql
);
}
public
function
query
(
string
$sql
):
Result
{
return
$this
->
wrappedConnection
->
query
(
$sql
);
}
/**
* {@inheritDoc}
*/
public
function
quote
(
$value
,
$type
=
ParameterType
::
STRING
)
{
return
$this
->
wrappedConnection
->
quote
(
$value
,
$type
);
}
public
function
exec
(
string
$sql
):
int
{
return
$this
->
wrappedConnection
->
exec
(
$sql
);
}
/**
* {@inheritDoc}
*/
public
function
lastInsertId
(
$name
=
null
)
{
if
(
$name
!==
null
)
{
Deprecation
::
triggerIfCalledFromOutside
(
'doctrine/dbal'
,
'https://github.com/doctrine/dbal/issues/4687'
,
'The usage of Connection::lastInsertId() with a sequence name is deprecated.'
,
);
}
return
$this
->
wrappedConnection
->
lastInsertId
(
$name
);
}
/**
* {@inheritDoc}
*/
public
function
beginTransaction
()
{
return
$this
->
wrappedConnection
->
beginTransaction
();
}
/**
* {@inheritDoc}
*/
public
function
commit
()
{
return
$this
->
wrappedConnection
->
commit
();
}
/**
* {@inheritDoc}
*/
public
function
rollBack
()
{
return
$this
->
wrappedConnection
->
rollBack
();
}
/**
* {@inheritDoc}
*/
public
function
getServerVersion
()
{
if
(!
$this
->
wrappedConnection
instanceof
ServerInfoAwareConnection
)
{
throw
new
LogicException
(
'The underlying connection is not a ServerInfoAwareConnection'
);
}
return
$this
->
wrappedConnection
->
getServerVersion
();
}
/** @return resource|object */
public
function
getNativeConnection
()
{
if
(!
method_exists
(
$this
->
wrappedConnection
,
'getNativeConnection'
))
{
throw
new
LogicException
(
sprintf
(
'The driver connection %s does not support accessing the native connection.'
,
get_class
(
$this
->
wrappedConnection
),
));
}
return
$this
->
wrappedConnection
->
getNativeConnection
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 03:04 (1 d, 10 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d5/32/78b8d70d7333f3b029b76ae8ca85
Default Alt Text
AbstractConnectionMiddleware.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment