eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery::bindParam PHP Method

bindParam() public method

. This method provides a shortcut for PDOStatement::bindParam when using prepared statements. The parameter $param specifies the variable that you want to bind. If $placeholder is not provided bind() will automatically create a placeholder for you. An automatic placeholder will be of the name 'placeholder1', 'placeholder2' etc. For more information see {@link http://php.net/pdostatement-bindparam} Example: $value = 2; $q->eq( 'id', $q->bindParam( $value ) ); $stmt = $q->prepare(); // the parameter $value is bound to the query. $value = 4; $stmt->execute(); // executed with 'id = 4'
See also: doBind()
public bindParam ( &mixed &$param, string $placeHolder = null, $type = PDO::PARAM_STR ) : string
$param &mixed
$placeHolder string the name to bind with. The string must start with a colon ':'.
return string the placeholder name used.
    public function bindParam(&$param, $placeHolder = null, $type = PDO::PARAM_STR)
    {
        if ($placeHolder === null) {
            ++$this->boundCounter;
            $placeHolder = ":placeholder{$this->boundCounter}";
        }
        $this->boundParameters[$placeHolder] =& $param;
        $this->boundParametersType[$placeHolder] = $type;
        return $placeHolder;
    }