You are here

private static function PHPExcel_Calculation_Database::__fieldExtract in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php \PHPExcel_Calculation_Database::__fieldExtract()

* __fieldExtract * * Extracts the column ID to use for the data field. * * @access private *

Parameters

mixed[] $database The range of cells that makes up the list or database.: * A database is a list of related data in which rows of related * information are records, and columns of data are fields. The * first row of the list contains labels for each column. * @param mixed $field Indicates which column is used in the function. Enter the * column label enclosed between double quotation marks, such as * "Age" or "Yield," or a number (without quotation marks) that * represents the position of the column within the list: 1 for * the first column, 2 for the second column, and so on. * @return string|NULL *

12 calls to PHPExcel_Calculation_Database::__fieldExtract()
PHPExcel_Calculation_Database::DAVERAGE in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DAVERAGE * * Averages the values in a column of a list or database that match conditions you specify. * * Excel Function: * DAVERAGE(database,field,criteria) * * @access public * @category Database Functions *
PHPExcel_Calculation_Database::DCOUNT in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DCOUNT * * Counts the cells that contain numbers in a column of a list or database that match conditions * that you specify. * * Excel Function: * DCOUNT(database,[field],criteria) * * Excel Function: …
PHPExcel_Calculation_Database::DCOUNTA in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DCOUNTA * * Counts the nonblank cells in a column of a list or database that match conditions that you specify. * * Excel Function: * DCOUNTA(database,[field],criteria) * * @access public * @category Database Functions *
PHPExcel_Calculation_Database::DGET in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DGET * * Extracts a single value from a column of a list or database that matches conditions that you * specify. * * Excel Function: * DGET(database,field,criteria) * * @access public * @category Database Functions *
PHPExcel_Calculation_Database::DMAX in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DMAX * * Returns the largest number in a column of a list or database that matches conditions you that * specify. * * Excel Function: * DMAX(database,field,criteria) * * @access public * @category Database Functions *

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php, line 67

Class

PHPExcel_Calculation_Database
PHPExcel_Calculation_Database

Code

private static function __fieldExtract($database, $field) {
  $field = strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($field));
  $fieldNames = array_map('strtoupper', array_shift($database));
  if (is_numeric($field)) {
    $keys = array_keys($fieldNames);
    return $keys[$field - 1];
  }
  $key = array_search($field, $fieldNames);
  return $key ? $key : NULL;
}