lib/Doctrine/DBAL/Query/QueryBuilder.php
public function setParameter($key, $value, $type = null)
    {
        if ($type !== null) {
            $this->paramTypes[$key] = $type;
        }

        $this->params[$key] = $value;

        return $this;
    }
public function setParameter($key, $value, $type = null)
    {
        if ($type !== null) {
            $this->paramTypes[$key] = $type;
        }

        $this->params[$key] = $value;

        return $this;
    }
public function setParameter ( $ key , $ value , $ type = null ) { if ( $ type !== null ) { $ this -> paramTypes [ $ key ] = $ type ; } $ this -> params [ $ key ] = $ value ; return $ this ; }
Sets a query parameter for the query being constructed.

<code>
$qb = $conn->createQueryBuilder()
->select('u')
->from('users', 'u')
->where('u.id = :user_id')
->setParameter(':user_id', 1);
</code>

@param string|int      $key   The parameter position or name.
@param mixed           $value The parameter value.
@param string|int|null $type  One of the {@link \Doctrine\DBAL\ParameterType} constants.

@return $this This QueryBuilder instance.
Sets a query parameter for the query being constructed .