Commit f20697e4 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Add some more comments for SQLParserUtils class.

parent 728243bb
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment