You are here

function hook_phpexcel_import in PHPExcel 7.2

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

Import

Parameters

string $op: The current operation

* &$data: The data. Depends on the operation. See documentation below for more information

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

array $options: The options for the phpexcel import

int $column: (optional) the column number

int $row: (optional) the row number

File

./phpexcel.api.php, line 105
Provide documentation to phpexcel hooks.

Code

function hook_phpexcel_import($op, &$data, &$phpexcel, $options, $column = NULL, $row = NULL) {
  switch ($op) {
    case 'full':

      /**
       * The $data parameter will contain the fully loaded Excel file, returned
       * by the PHPExcel_Reader object.
       *
       * The $phpexcel parameter will contain the PHPExcel_Reader object.
       */
      break;
    case 'sheet':

      /**
       * The $data parameter will contain the current PHPExcel_Worksheet.
       *
       * The $phpexcel parameter will contain the PHPExcel_Reader object.
       */
      break;
    case 'row':

      /**
       * The $data parameter will contain the current PHPExcel_Row.
       *
       * The $phpexcel parameter will contain the PHPExcel_Reader object.
       */
      break;
    case '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.
       *
       * The $phpexcel parameter will contain the PHPExcel_Cell object.
       *
       * The $column and $row parameters are set.
       */
      break;
    case 'post cell':

      /**
       * The $data parameter will contain the current cell value inside the data
       * array. The value can be altered.
       *
       * The $phpexcel parameter will contain the PHPExcel_Cell object.
       *
       * The $column and $row parameters are set.
       */
      break;
  }
}