You are here

function hook_phpexcel_import in PHPExcel 7.3

Same name and namespace in other branches
  1. 8.3 phpexcel.api.php \hook_phpexcel_import()
  2. 7.2 phpexcel.api.php \hook_phpexcel_import()

Implements hook_phpexcel_import().

Allows modules to interact with the importing of data. This hook is invoked at different stages of the import, represented by the $op parameter.

Parameters

string $op: The current operation. Either "full", "sheet", "row", "pre cell" or "post cell".

mixed &$data: The data. Depends on the value of $op:

  • "full": The $data parameter will contain the fully loaded Excel file, returned by the PHPExcel_Reader object.
  • "sheet": The $data parameter will contain the current PHPExcel_Worksheet.
  • "row": The $data parameter will contain the current PHPExcel_Row.
  • "pre cell": The $data parameter will contain the current cell value. The value has not been added to the data array and can still be altered.
  • "post cell": The $data parameter will contain the current cell value. The value cannot be altered anymore.

PHPExcel_Reader|PHPExcel_Worksheet|PHPExcel_Cell $phpexcel: The current object used. Can either be a PHPExcel_Reader object when loading the Excel file, a PHPExcel_Worksheet object when iterating through the worksheets or a PHPExcel_Cell object when reading data from a cell. Depends on the value of $op:

  • "full", "sheet" or "row": The $phpexcel parameter will contain the PHPExcel_Reader object.
  • "pre cell" or "post cell": The $phpexcel parameter will contain the PHPExcel_Cell object.

array $options: The arguments passed to phpexcel_import(), keyed by their name.

int $column: The column number. Only available when $op is "pre cell" or "post cell".

int $row: The row number. Only available when $op is "pre cell" or "post cell".

See also

phpexcel_import()

Related topics

File

./phpexcel.api.php, line 740
Module API documentation.

Code

function hook_phpexcel_import($op, &$data, $phpexcel, $options, $column = NULL, $row = NULL) {
  switch ($op) {
    case 'full':
      break;
    case 'sheet':
      break;
    case 'row':
      break;
    case 'pre cell':
      break;
    case 'post cell':
      break;
  }
}