You are here

public function StatementWrapper::bindColumn in Drupal 9

Bind a column to a PHP variable.

Parameters

mixed $column: Number of the column (1-indexed) or name of the column in the result set. If using the column name, be aware that the name should match the case of the column, as returned by the driver.

mixed $param: Name of the PHP variable to which the column will be bound.

int $type: (Optional) data type of the parameter, specified by the PDO::PARAM_* constants.

int $maxlen: (Optional) a hint for pre-allocation.

mixed $driverdata: (Optional) optional parameter(s) for the driver.

Return value

bool Returns TRUE on success or FALSE on failure.

Deprecated

in drupal:9.1.0 and is removed from drupal:10.0.0. StatementWrapper::bindColumn should not be called. Access the client-level statement object via ::getClientStatement().

See also

https://www.drupal.org/node/3177488

File

core/lib/Drupal/Core/Database/StatementWrapper.php, line 341

Class

StatementWrapper
Implementation of StatementInterface encapsulating PDOStatement.

Namespace

Drupal\Core\Database

Code

public function bindColumn($column, &$param, int $type = 0, int $maxlen = 0, $driverdata = NULL) : bool {
  @trigger_error("StatementWrapper::bindColumn should not be called in drupal:9.1.0 and will error in drupal:10.0.0. Access the client-level statement object via ::getClientStatement(). See https://www.drupal.org/node/3177488", E_USER_DEPRECATED);
  switch (func_num_args()) {
    case 2:
      return $this->clientStatement
        ->bindColumn($column, $param);
    case 3:
      return $this->clientStatement
        ->bindColumn($column, $param, $type);
    case 4:
      return $this->clientStatement
        ->bindColumn($column, $param, $type, $maxlen);
    case 5:
      return $this->clientStatement
        ->bindColumn($column, $param, $type, $maxlen, $driverdata);
  }
}