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
f20697e4
Commit
f20697e4
authored
Mar 05, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more comments for SQLParserUtils class.
parent
728243bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
SQLParserUtils.php
lib/Doctrine/DBAL/SQLParserUtils.php
+20
-0
No files found.
lib/Doctrine/DBAL/SQLParserUtils.php
View file @
f20697e4
...
@@ -22,8 +22,26 @@ namespace Doctrine\DBAL;
...
@@ -22,8 +22,26 @@ namespace Doctrine\DBAL;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Connection
;
/**
* Utility class that parses sql statements with regard to types and parameters.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class
SQLParserUtils
class
SQLParserUtils
{
{
/**
* Get an array of the placeholders in an sql statements as keys and their positions in the query string.
*
* Returns an integer => integer pair for a positional statement and a string => int[] pair for
* a named statement.
*
* @param string $statement
* @param bool $isPositional
* @return array
*/
static
public
function
getPlaceholderPositions
(
$statement
,
$isPositional
=
true
)
static
public
function
getPlaceholderPositions
(
$statement
,
$isPositional
=
true
)
{
{
$match
=
(
$isPositional
)
?
'?'
:
':'
;
$match
=
(
$isPositional
)
?
'?'
:
':'
;
...
@@ -59,6 +77,8 @@ class SQLParserUtils
...
@@ -59,6 +77,8 @@ class SQLParserUtils
}
}
/**
/**
* For a positional query this method can rewrite the sql statement with regard to array parameters.
*
* @param string $query
* @param string $query
* @param array $params
* @param array $params
* @param array $types
* @param array $types
...
...
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