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
7da630a1
Commit
7da630a1
authored
Nov 10, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Doctrine DBAL statement variables to protected, closes #GH-70
parent
7101ecd7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
48 deletions
+48
-48
Statement.php
lib/Doctrine/DBAL/Statement.php
+48
-48
No files found.
lib/Doctrine/DBAL/Statement.php
View file @
7da630a1
...
...
@@ -37,23 +37,23 @@ class Statement implements \IteratorAggregate, DriverStatement
/**
* @var string The SQL statement.
*/
pr
ivate
$_
sql
;
pr
otected
$
sql
;
/**
* @var array The bound parameters.
*/
pr
ivate
$_
params
=
array
();
pr
otected
$
params
=
array
();
/**
* @var Doctrine\DBAL\Driver\Statement The underlying driver statement.
*/
pr
ivate
$_
stmt
;
pr
otected
$
stmt
;
/**
* @var Doctrine\DBAL\Platforms\AbstractPlatform The underlying database platform.
*/
pr
ivate
$_
platform
;
pr
otected
$
platform
;
/**
* @var Doctrine\DBAL\Connection The connection this statement is bound to and executed on.
*/
pr
ivate
$_
conn
;
pr
otected
$
conn
;
/**
* Creates a new <tt>Statement</tt> for the given SQL and <tt>Connection</tt>.
...
...
@@ -63,10 +63,10 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
__construct
(
$sql
,
Connection
$conn
)
{
$this
->
_
sql
=
$sql
;
$this
->
_
stmt
=
$conn
->
getWrappedConnection
()
->
prepare
(
$sql
);
$this
->
_
conn
=
$conn
;
$this
->
_
platform
=
$conn
->
getDatabasePlatform
();
$this
->
sql
=
$sql
;
$this
->
stmt
=
$conn
->
getWrappedConnection
()
->
prepare
(
$sql
);
$this
->
conn
=
$conn
;
$this
->
platform
=
$conn
->
getDatabasePlatform
();
}
/**
...
...
@@ -84,20 +84,20 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
bindValue
(
$name
,
$value
,
$type
=
null
)
{
$this
->
_
params
[
$name
]
=
$value
;
$this
->
params
[
$name
]
=
$value
;
if
(
$type
!==
null
)
{
if
(
is_string
(
$type
))
{
$type
=
Type
::
getType
(
$type
);
}
if
(
$type
instanceof
Type
)
{
$value
=
$type
->
convertToDatabaseValue
(
$value
,
$this
->
_
platform
);
$value
=
$type
->
convertToDatabaseValue
(
$value
,
$this
->
platform
);
$bindingType
=
$type
->
getBindingType
();
}
else
{
$bindingType
=
$type
;
// PDO::PARAM_* constants
}
return
$this
->
_
stmt
->
bindValue
(
$name
,
$value
,
$bindingType
);
return
$this
->
stmt
->
bindValue
(
$name
,
$value
,
$bindingType
);
}
else
{
return
$this
->
_
stmt
->
bindValue
(
$name
,
$value
);
return
$this
->
stmt
->
bindValue
(
$name
,
$value
);
}
}
...
...
@@ -113,7 +113,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
bindParam
(
$name
,
&
$var
,
$type
=
PDO
::
PARAM_STR
)
{
return
$this
->
_
stmt
->
bindParam
(
$name
,
$var
,
$type
);
return
$this
->
stmt
->
bindParam
(
$name
,
$var
,
$type
);
}
/**
...
...
@@ -123,17 +123,17 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
execute
(
$params
=
null
)
{
$hasLogger
=
$this
->
_
conn
->
getConfiguration
()
->
getSQLLogger
();
$hasLogger
=
$this
->
conn
->
getConfiguration
()
->
getSQLLogger
();
if
(
$hasLogger
)
{
$this
->
_conn
->
getConfiguration
()
->
getSQLLogger
()
->
startQuery
(
$this
->
_sql
,
$this
->
_
params
);
$this
->
conn
->
getConfiguration
()
->
getSQLLogger
()
->
startQuery
(
$this
->
sql
,
$this
->
params
);
}
$stmt
=
$this
->
_
stmt
->
execute
(
$params
);
$stmt
=
$this
->
stmt
->
execute
(
$params
);
if
(
$hasLogger
)
{
$this
->
_
conn
->
getConfiguration
()
->
getSQLLogger
()
->
stopQuery
();
$this
->
conn
->
getConfiguration
()
->
getSQLLogger
()
->
stopQuery
();
}
$this
->
_
params
=
array
();
$this
->
params
=
array
();
return
$stmt
;
}
...
...
@@ -144,7 +144,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
closeCursor
()
{
return
$this
->
_
stmt
->
closeCursor
();
return
$this
->
stmt
->
closeCursor
();
}
/**
...
...
@@ -154,7 +154,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
columnCount
()
{
return
$this
->
_
stmt
->
columnCount
();
return
$this
->
stmt
->
columnCount
();
}
/**
...
...
@@ -164,7 +164,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
errorCode
()
{
return
$this
->
_
stmt
->
errorCode
();
return
$this
->
stmt
->
errorCode
();
}
/**
...
...
@@ -174,17 +174,17 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
errorInfo
()
{
return
$this
->
_
stmt
->
errorInfo
();
return
$this
->
stmt
->
errorInfo
();
}
public
function
setFetchMode
(
$fetchStyle
)
{
return
$this
->
_
stmt
->
setFetchMode
(
$fetchStyle
);
return
$this
->
stmt
->
setFetchMode
(
$fetchStyle
);
}
public
function
getIterator
()
{
return
$this
->
_
stmt
;
return
$this
->
stmt
;
}
/**
...
...
@@ -196,7 +196,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
fetch
(
$fetchStyle
=
PDO
::
FETCH_BOTH
)
{
return
$this
->
_
stmt
->
fetch
(
$fetchStyle
);
return
$this
->
stmt
->
fetch
(
$fetchStyle
);
}
/**
...
...
@@ -209,9 +209,9 @@ class Statement implements \IteratorAggregate, DriverStatement
public
function
fetchAll
(
$fetchStyle
=
PDO
::
FETCH_BOTH
,
$columnIndex
=
0
)
{
if
(
$columnIndex
!=
0
)
{
return
$this
->
_
stmt
->
fetchAll
(
$fetchStyle
,
$columnIndex
);
return
$this
->
stmt
->
fetchAll
(
$fetchStyle
,
$columnIndex
);
}
return
$this
->
_
stmt
->
fetchAll
(
$fetchStyle
);
return
$this
->
stmt
->
fetchAll
(
$fetchStyle
);
}
/**
...
...
@@ -222,7 +222,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
fetchColumn
(
$columnIndex
=
0
)
{
return
$this
->
_
stmt
->
fetchColumn
(
$columnIndex
);
return
$this
->
stmt
->
fetchColumn
(
$columnIndex
);
}
/**
...
...
@@ -232,7 +232,7 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
rowCount
()
{
return
$this
->
_
stmt
->
rowCount
();
return
$this
->
stmt
->
rowCount
();
}
/**
...
...
@@ -242,6 +242,6 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
getWrappedStatement
()
{
return
$this
->
_
stmt
;
return
$this
->
stmt
;
}
}
\ No newline at end of file
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