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
781ff38e
Commit
781ff38e
authored
Apr 04, 2012
by
Jim Cottrell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: save type information in Statement bindValue() for later passing to SQL logger
parent
f4069816
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Statement.php
lib/Doctrine/DBAL/Statement.php
+6
-2
No files found.
lib/Doctrine/DBAL/Statement.php
View file @
781ff38e
...
...
@@ -42,6 +42,10 @@ class Statement implements \IteratorAggregate, DriverStatement
* @var array The bound parameters.
*/
protected
$params
=
array
();
/**
* @var array The parameter types
*/
protected
$types
=
array
();
/**
* @var \Doctrine\DBAL\Driver\Statement The underlying driver statement.
*/
...
...
@@ -85,13 +89,13 @@ class Statement implements \IteratorAggregate, DriverStatement
public
function
bindValue
(
$name
,
$value
,
$type
=
null
)
{
$this
->
params
[
$name
]
=
$value
;
$this
->
types
[
$name
]
=
$type
;
if
(
$type
!==
null
)
{
if
(
is_string
(
$type
))
{
$type
=
Type
::
getType
(
$type
);
}
if
(
$type
instanceof
Type
)
{
$value
=
$type
->
convertToDatabaseValue
(
$value
,
$this
->
platform
);
$this
->
params
[
$name
]
=
$value
;
$bindingType
=
$type
->
getBindingType
();
}
else
{
$bindingType
=
$type
;
// PDO::PARAM_* constants
...
...
@@ -127,7 +131,7 @@ class Statement implements \IteratorAggregate, DriverStatement
{
$logger
=
$this
->
conn
->
getConfiguration
()
->
getSQLLogger
();
if
(
$logger
)
{
$logger
->
startQuery
(
$this
->
sql
,
$this
->
params
);
$logger
->
startQuery
(
$this
->
sql
,
$this
->
params
,
$this
->
types
);
}
$stmt
=
$this
->
stmt
->
execute
(
$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