Doctrine\DBAL\Query\QueryBuilder::createNamedParameter
Create a new named parameter and bind the value $value to it.
This method provides a shortcut for PDOStatement::bindValue when using prepared statements. The parameter $value specifies the value that you want to bind. If $placeholder is not provided bindValue() will automatically create a placeholder for you. An automatic placeholder will be of the name ':dcValue1', ':dcValue2' etc. For more information see Example: <code> $value = 2; $q->eq( 'id', $q->bindValue( $value ) ); $stmt = $q->executeQuery(); // executed with 'id = 2' </code>
- License: New BSD License
Signature
public function createNamedParameter(mixed
$value,
[mixed
$type = PDO::PARAM_STR,
[string
$placeHolder = null]] )
Parameters
$value
— mixed$type
— mixed$placeHolder
— string- the name to bind with. The string must start with a colon ':'.
Returns
- string
- the placeholder name used.