ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Cell.php
Go to the documentation of this file.
1 <?php
37 {
38 
44  const DEFAULT_RANGE = 'A1:A1';
45 
51  private static $_valueBinder = NULL;
52 
58  private $_value;
59 
70  private $_calculatedValue = NULL;
71 
77  private $_dataType;
78 
84  private $_parent;
85 
91  private $_xfIndex = 0;
92 
98 
99 
105  public function notifyCacheController() {
106  $this->_parent->updateCacheData($this);
107 
108  return $this;
109  }
110 
111  public function detach() {
112  $this->_parent = NULL;
113  }
114 
116  $this->_parent = $parent;
117  }
118 
119 
128  public function __construct($pValue = NULL, $pDataType = NULL, PHPExcel_Worksheet $pSheet = NULL)
129  {
130  // Initialise cell value
131  $this->_value = $pValue;
132 
133  // Set worksheet cache
134  $this->_parent = $pSheet->getCellCacheController();
135 
136  // Set datatype?
137  if ($pDataType !== NULL) {
138  if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
140  $this->_dataType = $pDataType;
141  } elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
142  throw new PHPExcel_Exception("Value could not be bound to cell.");
143  }
144  }
145 
151  public function getColumn()
152  {
153  return $this->_parent->getCurrentColumn();
154  }
155 
161  public function getRow()
162  {
163  return $this->_parent->getCurrentRow();
164  }
165 
171  public function getCoordinate()
172  {
173  return $this->_parent->getCurrentAddress();
174  }
175 
181  public function getValue()
182  {
183  return $this->_value;
184  }
185 
191  public function getFormattedValue()
192  {
194  $this->getCalculatedValue(),
195  $this->getStyle()
196  ->getNumberFormat()->getFormatCode()
197  );
198  }
199 
209  public function setValue($pValue = NULL)
210  {
211  if (!self::getValueBinder()->bindValue($this, $pValue)) {
212  throw new PHPExcel_Exception("Value could not be bound to cell.");
213  }
214  return $this;
215  }
216 
225  public function setValueExplicit($pValue = NULL, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
226  {
227  // set the value according to data type
228  switch ($pDataType) {
230  $this->_value = $pValue;
231  break;
236  $this->_value = PHPExcel_Cell_DataType::checkString($pValue);
237  break;
239  $this->_value = (float)$pValue;
240  break;
242  $this->_value = (string)$pValue;
243  break;
245  $this->_value = (bool)$pValue;
246  break;
248  $this->_value = PHPExcel_Cell_DataType::checkErrorCode($pValue);
249  break;
250  default:
251  throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType);
252  break;
253  }
254 
255  // set the datatype
256  $this->_dataType = $pDataType;
257 
258  return $this->notifyCacheController();
259  }
260 
270  public function getCalculatedValue($resetLog = TRUE)
271  {
272 //echo 'Cell '.$this->getCoordinate().' value is a '.$this->_dataType.' with a value of '.$this->getValue().PHP_EOL;
273  if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
274  try {
275 //echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL;
277  $this->getWorksheet()->getParent()
278  )->calculateCellValue($this,$resetLog);
279 //echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL;
280  // We don't yet handle array returns
281  if (is_array($result)) {
282  while (is_array($result)) {
283  $result = array_pop($result);
284  }
285  }
286  } catch ( PHPExcel_Exception $ex ) {
287  if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->_calculatedValue !== NULL)) {
288 //echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
289  return $this->_calculatedValue; // Fallback for calculations referencing external files.
290  }
291 //echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
292  $result = '#N/A';
294  $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
295  );
296  }
297 
298  if ($result === '#Not Yet Implemented') {
299 //echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
300  return $this->_calculatedValue; // Fallback if calculation engine does not support the formula.
301  }
302 //echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL;
303  return $result;
304  } elseif($this->_value instanceof PHPExcel_RichText) {
305 // echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->_value.'<br />';
306  return $this->_value->getPlainText();
307  }
308 // echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->_value.'<br />';
309  return $this->_value;
310  }
311 
318  public function setCalculatedValue($pValue = NULL)
319  {
320  if ($pValue !== NULL) {
321  $this->_calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
322  }
323 
324  return $this->notifyCacheController();
325  }
326 
337  public function getOldCalculatedValue()
338  {
340  }
341 
347  public function getDataType()
348  {
349  return $this->_dataType;
350  }
351 
358  public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
359  {
360  if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
362 
363  $this->_dataType = $pDataType;
364 
365  return $this->notifyCacheController();
366  }
367 
373  public function isFormula()
374  {
375  return $this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA;
376  }
377 
384  public function hasDataValidation()
385  {
386  if (!isset($this->_parent)) {
387  throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet');
388  }
389 
390  return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
391  }
392 
399  public function getDataValidation()
400  {
401  if (!isset($this->_parent)) {
402  throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet');
403  }
404 
405  return $this->getWorksheet()->getDataValidation($this->getCoordinate());
406  }
407 
415  public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = NULL)
416  {
417  if (!isset($this->_parent)) {
418  throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
419  }
420 
421  $this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
422 
423  return $this->notifyCacheController();
424  }
425 
432  public function hasHyperlink()
433  {
434  if (!isset($this->_parent)) {
435  throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
436  }
437 
438  return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
439  }
440 
447  public function getHyperlink()
448  {
449  if (!isset($this->_parent)) {
450  throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
451  }
452 
453  return $this->getWorksheet()->getHyperlink($this->getCoordinate());
454  }
455 
463  public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = NULL)
464  {
465  if (!isset($this->_parent)) {
466  throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
467  }
468 
469  $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
470 
471  return $this->notifyCacheController();
472  }
473 
479  public function getParent() {
480  return $this->_parent;
481  }
482 
488  public function getWorksheet() {
489  return $this->_parent->getParent();
490  }
491 
497  public function isInMergeRange() {
498  return (boolean) $this->getMergeRange();
499  }
500 
506  public function isMergeRangeValueCell() {
507  if ($mergeRange = $this->getMergeRange()) {
508  $mergeRange = PHPExcel_Cell::splitRange($mergeRange);
509  list($startCell) = $mergeRange[0];
510  if ($this->getCoordinate() === $startCell) {
511  return true;
512  }
513  }
514  return false;
515  }
516 
522  public function getMergeRange() {
523  foreach($this->getWorksheet()->getMergeCells() as $mergeRange) {
524  if ($this->isInRange($mergeRange)) {
525  return $mergeRange;
526  }
527  }
528  return false;
529  }
530 
536  public function getStyle()
537  {
538  return $this->getWorksheet()->getStyle($this->getCoordinate());
539  }
540 
547  public function rebindParent(PHPExcel_Worksheet $parent) {
548  $this->_parent = $parent->getCellCacheController();
549 
550  return $this->notifyCacheController();
551  }
552 
559  public function isInRange($pRange = 'A1:A1')
560  {
561  list($rangeStart,$rangeEnd) = self::rangeBoundaries($pRange);
562 
563  // Translate properties
564  $myColumn = self::columnIndexFromString($this->getColumn());
565  $myRow = $this->getRow();
566 
567  // Verify if cell is in range
568  return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
569  ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow)
570  );
571  }
572 
580  public static function coordinateFromString($pCoordinateString = 'A1')
581  {
582  if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
583  return array($matches[1],$matches[2]);
584  } elseif ((strpos($pCoordinateString,':') !== FALSE) || (strpos($pCoordinateString,',') !== FALSE)) {
585  throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
586  } elseif ($pCoordinateString == '') {
587  throw new PHPExcel_Exception('Cell coordinate can not be zero-length string');
588  }
589 
590  throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString);
591  }
592 
601  public static function absoluteReference($pCoordinateString = 'A1')
602  {
603  if (strpos($pCoordinateString,':') === FALSE && strpos($pCoordinateString,',') === FALSE) {
604  // Split out any worksheet name from the reference
605  $worksheet = '';
606  $cellAddress = explode('!',$pCoordinateString);
607  if (count($cellAddress) > 1) {
608  list($worksheet,$pCoordinateString) = $cellAddress;
609  }
610  if ($worksheet > '') $worksheet .= '!';
611 
612  // Create absolute coordinate
613  if (ctype_digit($pCoordinateString)) {
614  return $worksheet . '$' . $pCoordinateString;
615  } elseif (ctype_alpha($pCoordinateString)) {
616  return $worksheet . '$' . strtoupper($pCoordinateString);
617  }
618  return $worksheet . self::absoluteCoordinate($pCoordinateString);
619  }
620 
621  throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
622  }
623 
631  public static function absoluteCoordinate($pCoordinateString = 'A1')
632  {
633  if (strpos($pCoordinateString,':') === FALSE && strpos($pCoordinateString,',') === FALSE) {
634  // Split out any worksheet name from the coordinate
635  $worksheet = '';
636  $cellAddress = explode('!',$pCoordinateString);
637  if (count($cellAddress) > 1) {
638  list($worksheet,$pCoordinateString) = $cellAddress;
639  }
640  if ($worksheet > '') $worksheet .= '!';
641 
642  // Create absolute coordinate
643  list($column, $row) = self::coordinateFromString($pCoordinateString);
644  $column = ltrim($column,'$');
645  $row = ltrim($row,'$');
646  return $worksheet . '$' . $column . '$' . $row;
647  }
648 
649  throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
650  }
651 
660  public static function splitRange($pRange = 'A1:A1')
661  {
662  // Ensure $pRange is a valid range
663  if(empty($pRange)) {
664  $pRange = self::DEFAULT_RANGE;
665  }
666 
667  $exploded = explode(',', $pRange);
668  $counter = count($exploded);
669  for ($i = 0; $i < $counter; ++$i) {
670  $exploded[$i] = explode(':', $exploded[$i]);
671  }
672  return $exploded;
673  }
674 
682  public static function buildRange($pRange)
683  {
684  // Verify range
685  if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) {
686  throw new PHPExcel_Exception('Range does not contain any information');
687  }
688 
689  // Build range
690  $imploded = array();
691  $counter = count($pRange);
692  for ($i = 0; $i < $counter; ++$i) {
693  $pRange[$i] = implode(':', $pRange[$i]);
694  }
695  $imploded = implode(',', $pRange);
696 
697  return $imploded;
698  }
699 
707  public static function rangeBoundaries($pRange = 'A1:A1')
708  {
709  // Ensure $pRange is a valid range
710  if(empty($pRange)) {
711  $pRange = self::DEFAULT_RANGE;
712  }
713 
714  // Uppercase coordinate
715  $pRange = strtoupper($pRange);
716 
717  // Extract range
718  if (strpos($pRange, ':') === FALSE) {
719  $rangeA = $rangeB = $pRange;
720  } else {
721  list($rangeA, $rangeB) = explode(':', $pRange);
722  }
723 
724  // Calculate range outer borders
725  $rangeStart = self::coordinateFromString($rangeA);
726  $rangeEnd = self::coordinateFromString($rangeB);
727 
728  // Translate column into index
729  $rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
730  $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
731 
732  return array($rangeStart, $rangeEnd);
733  }
734 
741  public static function rangeDimension($pRange = 'A1:A1')
742  {
743  // Calculate range outer borders
744  list($rangeStart,$rangeEnd) = self::rangeBoundaries($pRange);
745 
746  return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) );
747  }
748 
756  public static function getRangeBoundaries($pRange = 'A1:A1')
757  {
758  // Ensure $pRange is a valid range
759  if(empty($pRange)) {
760  $pRange = self::DEFAULT_RANGE;
761  }
762 
763  // Uppercase coordinate
764  $pRange = strtoupper($pRange);
765 
766  // Extract range
767  if (strpos($pRange, ':') === FALSE) {
768  $rangeA = $rangeB = $pRange;
769  } else {
770  list($rangeA, $rangeB) = explode(':', $pRange);
771  }
772 
773  return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB));
774  }
775 
782  public static function columnIndexFromString($pString = 'A')
783  {
784  // Using a lookup cache adds a slight memory overhead, but boosts speed
785  // caching using a static within the method is faster than a class static,
786  // though it's additional memory overhead
787  static $_indexCache = array();
788 
789  if (isset($_indexCache[$pString]))
790  return $_indexCache[$pString];
791 
792  // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord()
793  // and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant
794  // memory overhead either
795  static $_columnLookup = array(
796  'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13,
797  'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26,
798  'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13,
799  'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26
800  );
801 
802  // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
803  // for improved performance
804  if (isset($pString{0})) {
805  if (!isset($pString{1})) {
806  $_indexCache[$pString] = $_columnLookup[$pString];
807  return $_indexCache[$pString];
808  } elseif(!isset($pString{2})) {
809  $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}];
810  return $_indexCache[$pString];
811  } elseif(!isset($pString{3})) {
812  $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}];
813  return $_indexCache[$pString];
814  }
815  }
816  throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
817  }
818 
825  public static function stringFromColumnIndex($pColumnIndex = 0)
826  {
827  // Using a lookup cache adds a slight memory overhead, but boosts speed
828  // caching using a static within the method is faster than a class static,
829  // though it's additional memory overhead
830  static $_indexCache = array();
831 
832  if (!isset($_indexCache[$pColumnIndex])) {
833  // Determine column string
834  if ($pColumnIndex < 26) {
835  $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
836  } elseif ($pColumnIndex < 702) {
837  $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
838  chr(65 + $pColumnIndex % 26);
839  } else {
840  $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
841  chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
842  chr(65 + $pColumnIndex % 26);
843  }
844  }
845  return $_indexCache[$pColumnIndex];
846  }
847 
854  public static function extractAllCellReferencesInRange($pRange = 'A1') {
855  // Returnvalue
856  $returnValue = array();
857 
858  // Explode spaces
859  $cellBlocks = explode(' ', str_replace('$', '', strtoupper($pRange)));
860  foreach ($cellBlocks as $cellBlock) {
861  // Single cell?
862  if (strpos($cellBlock,':') === FALSE && strpos($cellBlock,',') === FALSE) {
863  $returnValue[] = $cellBlock;
864  continue;
865  }
866 
867  // Range...
868  $ranges = self::splitRange($cellBlock);
869  foreach($ranges as $range) {
870  // Single cell?
871  if (!isset($range[1])) {
872  $returnValue[] = $range[0];
873  continue;
874  }
875 
876  // Range...
877  list($rangeStart, $rangeEnd) = $range;
878  sscanf($rangeStart,'%[A-Z]%d', $startCol, $startRow);
879  sscanf($rangeEnd,'%[A-Z]%d', $endCol, $endRow);
880  $endCol++;
881 
882  // Current data
883  $currentCol = $startCol;
884  $currentRow = $startRow;
885 
886  // Loop cells
887  while ($currentCol != $endCol) {
888  while ($currentRow <= $endRow) {
889  $returnValue[] = $currentCol.$currentRow;
890  ++$currentRow;
891  }
892  ++$currentCol;
893  $currentRow = $startRow;
894  }
895  }
896  }
897 
898  // Sort the result by column and row
899  $sortKeys = array();
900  foreach (array_unique($returnValue) as $coord) {
901  sscanf($coord,'%[A-Z]%d', $column, $row);
902  $sortKeys[sprintf('%3s%09d',$column,$row)] = $coord;
903  }
904  ksort($sortKeys);
905 
906  // Return value
907  return array_values($sortKeys);
908  }
909 
917  public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b)
918  {
919  if ($a->getRow() < $b->getRow()) {
920  return -1;
921  } elseif ($a->getRow() > $b->getRow()) {
922  return 1;
923  } elseif (self::columnIndexFromString($a->getColumn()) < self::columnIndexFromString($b->getColumn())) {
924  return -1;
925  } else {
926  return 1;
927  }
928  }
929 
935  public static function getValueBinder() {
936  if (self::$_valueBinder === NULL) {
937  self::$_valueBinder = new PHPExcel_Cell_DefaultValueBinder();
938  }
939 
940  return self::$_valueBinder;
941  }
942 
949  public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = NULL) {
950  if ($binder === NULL) {
951  throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly.");
952  }
953 
954  self::$_valueBinder = $binder;
955  }
956 
960  public function __clone() {
961  $vars = get_object_vars($this);
962  foreach ($vars as $key => $value) {
963  if ((is_object($value)) && ($key != '_parent')) {
964  $this->$key = clone $value;
965  } else {
966  $this->$key = $value;
967  }
968  }
969  }
970 
976  public function getXfIndex()
977  {
978  return $this->_xfIndex;
979  }
980 
987  public function setXfIndex($pValue = 0)
988  {
989  $this->_xfIndex = $pValue;
990 
991  return $this->notifyCacheController();
992  }
993 
997  public function setFormulaAttributes($pAttributes)
998  {
999  $this->_formulaAttributes = $pAttributes;
1000  return $this;
1001  }
1002 
1006  public function getFormulaAttributes()
1007  {
1009  }
1010 
1016  public function __toString()
1017  {
1018  return (string) $this->getValue();
1019  }
1020 
1021 }
1022 
Add rich text string
static splitRange($pRange='A1:A1')
Split range into coordinate strings.
Definition: Cell.php:660
setFormulaAttributes($pAttributes)
Definition: Cell.php:997
$worksheet
static coordinateFromString($pCoordinateString='A1')
Coordinate from string.
Definition: Cell.php:580
setDataType($pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
Set cell data type.
Definition: Cell.php:358
$result
static compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b)
Compare 2 cells.
Definition: Cell.php:917
getFormulaAttributes()
Definition: Cell.php:1006
getFormattedValue()
Get cell value with formatting.
Definition: Cell.php:191
static absoluteCoordinate($pCoordinateString='A1')
Make string coordinate absolute.
Definition: Cell.php:631
__toString()
Convert to string.
Definition: Cell.php:1016
setXfIndex($pValue=0)
Set index to cellXf.
Definition: Cell.php:987
static rangeDimension($pRange='A1:A1')
Calculate range dimension.
Definition: Cell.php:741
static $_valueBinder
Definition: Cell.php:51
static rangeBoundaries($pRange='A1:A1')
Calculate range boundaries.
Definition: Cell.php:707
static setValueBinder(PHPExcel_Cell_IValueBinder $binder=NULL)
Set value binder to use.
Definition: Cell.php:949
isInMergeRange()
Is this cell in a merge range.
Definition: Cell.php:497
getColumn()
Get cell coordinate column.
Definition: Cell.php:151
__construct($pValue=NULL, $pDataType=NULL, PHPExcel_Worksheet $pSheet=NULL)
Create a new Cell.
Definition: Cell.php:128
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
Definition: Cell.php:960
getStyle()
Get cell style.
Definition: Cell.php:536
hasDataValidation()
Does this cell contain Data validation rules?
Definition: Cell.php:384
isFormula()
Identify if the cell contains a formula.
Definition: Cell.php:373
rebindParent(PHPExcel_Worksheet $parent)
Re-bind parent.
Definition: Cell.php:547
static checkString($pValue=null)
Check a string that it satisfies Excel requirements.
Definition: DataType.php:89
static getValueBinder()
Get value binder to use.
Definition: Cell.php:935
$counter
getHyperlink()
Get Hyperlink.
Definition: Cell.php:447
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getCalculatedValue($resetLog=TRUE)
Get calculated cell value.
Definition: Cell.php:270
setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation=NULL)
Set Data validation rules.
Definition: Cell.php:415
static buildRange($pRange)
Build range from coordinate strings.
Definition: Cell.php:682
$column
Definition: 39dropdown.php:62
const DEFAULT_RANGE
Definition: Cell.php:44
setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink=NULL)
Set Hyperlink.
Definition: Cell.php:463
getXfIndex()
Get index to cellXf.
Definition: Cell.php:976
setCalculatedValue($pValue=NULL)
Set old calculated value (cached)
Definition: Cell.php:318
getValue()
Get cell value.
Definition: Cell.php:181
isMergeRangeValueCell()
Is this cell the master (top left cell) in a merge range (that holds the actual data value) ...
Definition: Cell.php:506
$_formulaAttributes
Attributes of the formula.
Definition: Cell.php:97
getMergeRange()
If this cell is in a merge range, then return the range.
Definition: Cell.php:522
isInRange($pRange='A1:A1')
Is cell in a specific range?
Definition: Cell.php:559
hasHyperlink()
Does this cell contain a Hyperlink?
Definition: Cell.php:432
Create styles array
The data for the language used.
attach(PHPExcel_CachedObjectStorage_CacheBase $parent)
Definition: Cell.php:115
getDataValidation()
Get Data validation rules.
Definition: Cell.php:399
$_calculatedValue
Definition: Cell.php:70
static extractAllCellReferencesInRange($pRange='A1')
Extract all cell references in range.
Definition: Cell.php:854
static columnIndexFromString($pString='A')
Column index from string.
Definition: Cell.php:782
static getRangeBoundaries($pRange='A1:A1')
Calculate range boundaries.
Definition: Cell.php:756
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.
setValueExplicit($pValue=NULL, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the ...
Definition: Cell.php:225
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
Definition: Cell.php:825
getCellCacheController()
Return the cache controller for the cell collection.
Definition: Worksheet.php:413
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
$i
Definition: disco.tpl.php:19
getDataType()
Get cell data type.
Definition: Cell.php:347
setValue($pValue=NULL)
Set cell value.
Definition: Cell.php:209
getOldCalculatedValue()
Get old calculated value (cached) This returns the value last calculated by MS Excel or whichever spr...
Definition: Cell.php:337
getParent()
Get parent worksheet.
Definition: Cell.php:479
static toFormattedString($value='0', $format=PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack=null)
Convert a value in a pre-defined format to a PHP string.
$key
Definition: croninfo.php:18
getRow()
Get cell coordinate row.
Definition: Cell.php:161
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
static absoluteReference($pCoordinateString='A1')
Make string row, column or cell coordinate absolute.
Definition: Cell.php:601
static checkErrorCode($pValue=null)
Check a value that it is a valid error code.
Definition: DataType.php:111