db_field_names

Definition

db_field_names($fields)
drupal/includes/database/database.inc, line 1908

Description

Return an array of field names from an array of key/index column specifiers.

This is usually an identity function but if a key/index uses a column prefix specification, this function extracts just the name.

Parameters

$fields An array of key/index column specifiers.

Return value

An array of field names.

Related topics

Namesort iconDescription
Schema APIA Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema(), which usually lives in a modulename.install file.

Code

function db_field_names($fields) {
  return Database::getActiveConnection()->schema()->fieldNames($fields);
}