eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery::bindValue PHP Метод

bindValue() публичный Метод

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 'placeholder1', 'placeholder2' etc. For more information see {@link http://php.net/pdostatement-bindparam} Example: $value = 2; $q->eq( 'id', $q->bindValue( $value ) ); $stmt = $q->prepare(); // the value 2 is bound to the query. $value = 4; $stmt->execute(); // executed with 'id = 2'
public bindValue ( mixed $value, string $placeHolder = null, $type = PDO::PARAM_STR ) : string
$value mixed
$placeHolder string the name to bind with. The string must start with a colon ':'.
Результат string the placeholder name used.
    public function bindValue($value, $placeHolder = null, $type = PDO::PARAM_STR)
    {
        if ($placeHolder === null) {
            ++$this->boundCounter;
            $placeHolder = ":placeholder{$this->boundCounter}";
        }
        $this->boundValues[$placeHolder] = $value;
        $this->boundValuesType[$placeHolder] = $type;
        return $placeHolder;
    }