Doctrine\DBAL\Statement::bindParam PHP Метод

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

Binding a parameter by reference does not support DBAL mapping types.
public bindParam ( string $name, mixed &$var, integer $type = PDO::PARAM_STR, integer | null $length = null ) : boolean
$name string The name or position of the parameter.
$var mixed The reference to the variable to bind.
$type integer The PDO binding type.
$length integer | null Must be specified when using an OUT bind so that PHP allocates enough memory to hold the returned value.
Результат boolean TRUE on success, FALSE on failure.
    public function bindParam($name, &$var, $type = PDO::PARAM_STR, $length = null)
    {
        $this->params[$name] = $var;
        $this->types[$name] = $type;
        return $this->stmt->bindParam($name, $var, $type, $length);
    }

Usage Example

 /**
  * Performs binding of variables bound with bindValue and bindParam on the statement $stmt.
  *
  * This method must be called if you have used the bind methods
  * in your query and you build the method yourself using build.
  *
  * @param \Doctrine\DBAL\Statement $stmt
  */
 private function doBind(Statement $stmt)
 {
     foreach ($this->boundValues as $key => $value) {
         $stmt->bindValue($key, $value, $this->boundValuesType[$key]);
     }
     foreach ($this->boundParameters as $key => &$value) {
         $stmt->bindParam($key, $value, $this->boundParametersType[$key]);
     }
 }
All Usage Examples Of Doctrine\DBAL\Statement::bindParam